A change in
TWikirev:16846
(for
Item5656) has broken
trunk
for UTF8 sites.
+ # Tell CGI.pm which charset we are using if not default
+ if( defined $TWiki::cfg{Site}{CharSet} &&
+ $TWiki::cfg{Site}{CharSet} !~ /^iso-?8859-?1$/io ) {
+ $query->charset( $TWiki::cfg{Site}{CharSet} );
+ }
This causes CGI to automatically and silently translate URL parameters to unicode. You would expect that to be correct, but unfortunately the rest of TWiki assumes they are UTF8 encoded, and not unicode, and this causes a crash deep in
RcsFile.pm viz
Wide character in print
.
To reproduce the problem, configure a site to {Site}{CharSet} = 'utf-8' and edit a new topic using the raw editor. Paste in the first line of
http://en.wikipedia.org/wiki/Chinese_language
(the line with the chinese characters on it) and save the topic.
The solution is to change this call back to
CGI::charset
instead of
$query->charset
, as this doesn't cause conversion of the parameters to unicode.
--
TWiki:Main/CrawfordCurrie
- 17 Jun 2008
that change is in twiki42 branch as well :/
--
TWiki:Main.SvenDowideit
- 17 Jun 2008
The behaviour is an undocument side-effect of CGI::charset, and has been reported to CPAN.
http://rt.cpan.org/Ticket/Display.html?id=36817
--
CrawfordCurrie - 17 Jun 2008
One thing is the report to CPAN. Another TWiki.
I do not see the fix checked in???
--
TWiki:Main.KennethLavrsen
- 01 Jul 2008
Fix checked in in agreement with Crawford.
Bug was never in released version so closing
--
TWiki:Main.KennethLavrsen
- 15 Jul 2008