Use the pure perl Data::Dumper when generating setup files to ensure that utf-8 characters are written out as such, and not as the encoded perl strings the C Data::Dumper produces.

Note that the text produced by the C version was interpreted fine
when ikiwiki loaded the setup file. But it was not user-friendly.
master
Joey Hess 2008-10-19 21:23:48 -04:00
parent 3e992b758b
commit 423fae6f18
3 changed files with 8 additions and 1 deletions

View File

@ -26,6 +26,8 @@ sub dumpline ($$$$) { #{{{
local $Data::Dumper::Pad="\t";
local $Data::Dumper::Sortkeys=1;
local $Data::Dumper::Quotekeys=0;
# only the perl version preserves utf-8 in output
local $Data::Dumper::Useperl=1;
my $dumpedvalue;
if (($type eq 'boolean' || $type eq 'integer') && $value=~/^[0-9]+$/) {

3
debian/changelog vendored
View File

@ -14,6 +14,9 @@ ikiwiki (2.68) UNRELEASED; urgency=low
formatted time.
* Fix issue with utf-8 in wikiname breaking session cookies, by
entity-encoding the wikiname in the session cookie.
* Use the pure perl Data::Dumper when generating setup files to ensure that
utf-8 characters are written out as such, and not as the encoded perl
strings the C Data::Dumper produces.
-- Joey Hess <joeyh@debian.org> Fri, 17 Oct 2008 20:11:02 -0400

View File

@ -9,6 +9,8 @@ Replacing "·" with "-" in `wikiname` fixed this login issue.
> the wikiname. But it doesn't seem to work, somehow the encoded utf-8
> value still doesn't make it through. (CGI::Session seems to have underermined utf-8
> issues too.) Seems like I will have to possibly break some sessions and
> entity-encode the wikiname in the cookie.. done. --[[Joey]]
> entity-encode the wikiname in the cookie.. [[done]]. --[[Joey]]
(BTW, such a char was replaced by -I don't remember what encoding thingie- in my setup file, when running `ikiwiki-transition setupformat`.)
> Thanks for the heads up, fixed that too. --[[Joey]]