diff options
author | Joey Hess <joey@kitenet.net> | 2012-01-15 16:39:13 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-01-15 16:39:13 -0400 |
commit | 1572c3c376df36ea09e27a1ea437e3a75cdf0f84 (patch) | |
tree | 10841cf0f4dadb83f35ed55df0286dac58f65469 /doc | |
parent | 1d356fdf8b826ac564d8e04d32785367f53e4556 (diff) | |
download | ikiwiki-1572c3c376df36ea09e27a1ea437e3a75cdf0f84.tar ikiwiki-1572c3c376df36ea09e27a1ea437e3a75cdf0f84.tar.gz |
attachment: Fix utf-8 display bug.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/bugs/UTF-8_in_attachment_filenames.mdwn | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/doc/bugs/UTF-8_in_attachment_filenames.mdwn b/doc/bugs/UTF-8_in_attachment_filenames.mdwn index 6e79a4e06..07fff88d2 100644 --- a/doc/bugs/UTF-8_in_attachment_filenames.mdwn +++ b/doc/bugs/UTF-8_in_attachment_filenames.mdwn @@ -1,4 +1,9 @@ -I have ikiwiki_3.20111229 installed on Debian Squeeze (Perl 5.10.1, UTF-8 locale). The attachment plugin mangles UTF8-encoded attachment filenames if the name contains multibyte characters, e.g. "lää.png" becomes "lää.png". Apparently glob returns byte strings which are subject to implicit upgrading when concatenated with Perl strings. The following patch fixes the problem for me: +I have ikiwiki_3.20111229 installed on Debian Squeeze (Perl 5.10.1, UTF-8 +locale). The attachment plugin mangles UTF8-encoded attachment filenames if +the name contains multibyte characters, e.g. "lää.png" becomes "lää.png". +Apparently glob returns byte strings which are subject to implicit +upgrading when concatenated with Perl strings. The following patch fixes +the problem for me: ---- @@ -13,3 +18,8 @@ I have ikiwiki_3.20111229 installed on Debian Squeeze (Perl 5.10.1, UTF-8 locale foreach my $file (glob("$dir/*")) { + $file = Encode::decode_utf8($file); next unless -f $file; + +> Seems it only mangled display of the just-uploaded attachment's filename, +> the attachment was otherwise saved to disk with a valid UTF-8 name, and +> doing other stuff with it also was ok. In any case, I applied your patch, +> thanks. [[done]] --[[Joey]] |