[Koha-bugs] [Bug 6554] Resolve encoding problems with corrected UTF8 handling in templates

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Mar 29 09:19:43 CET 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6554

--- Comment #78 from M. de Rooy <m.de.rooy at rijksmuseum.nl> ---
(In reply to comment #66)
> I would prefer to leave utf-8 decoding of parameters to CGI module using:
> use CGI qw(-utf8);
> This ensures that we are decoding all parameters and produce much less code.
> Additional benefit is that we are not missing any parameters, possibly
> creating undecoded params which can break encoding down the road.
> 
> Use this with care, as it will interfere with the processing of binary 
> uploads. It is better to manually select which fields are expected to return
> utf-8 strings and convert them using code like this:
>             my $arg = decode utf8=>param('foo');
> 
> Can I squash your followups in one patch and use CGI qw(-utf8) to solve it?
> 
> I think we might also benefit from README.utf-8 which explains how to handle
> encoding in Koha for easier reference in future.

Thanks, Dobrica.

The choice between -utf8 flag for CGI and individual decodes is arbitrary. The
utf8 flag may do some unneeded decodes and could affect binary uploads, but I
am not sure if that really interferes with Koha somewhere. The decode option is
marked as safer, adds little more code but probably does less decodes.
Disadvantage is forgetting to decode one parameter.

At this moment in time, I would prefer to leave the patches on this report as
they are now. We tested; your change should go in now. I will open up a new
report to catch the remaining places of incorrect parameter encoding. And will
send a short mail to the dev list for further opinions on the best practice in
this regard. This is easily addressed later.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list