From: joey Date: Wed, 5 Sep 2007 17:22:26 +0000 (+0000) Subject: * table: Text::CSV doesn't return decoded unicode (XS module); decode its X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/8489e68916eabf0ce09242e4dac66b9f646d46c4?hp=b3f2cc414f0239a3b8dbe700cc7cbd2750814dd3 * table: Text::CSV doesn't return decoded unicode (XS module); decode its return values. --- diff --git a/IkiWiki.pm b/IkiWiki.pm index 0c1df8b47..720afdecd 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -903,7 +903,7 @@ sub template_params (@) { #{{{ my @ret=( filter => sub { my $text_ref = shift; - ${$text_ref} = Encode::decode_utf8(${$text_ref}); + ${$text_ref} = decode_utf8(${$text_ref}); }, filename => $filename, loop_context_vars => 1, diff --git a/IkiWiki/Plugin/table.pm b/IkiWiki/Plugin/table.pm index c7b664052..01ba5e504 100644 --- a/IkiWiki/Plugin/table.pm +++ b/IkiWiki/Plugin/table.pm @@ -3,6 +3,7 @@ package IkiWiki::Plugin::table; use warnings; use strict; +use Encode; use IkiWiki 2.00; sub import { #{{{ @@ -104,7 +105,7 @@ sub split_csv ($$) { #{{{ foreach my $line (@text_lines) { $l++; if ($csv->parse($line)) { - push(@data, [ $csv->fields() ]); + push(@data, [ map { decode_utf8 $_ } $csv->fields() ]); } else { debug(sprintf(gettext('parse fail at line %d: %s'), diff --git a/debian/changelog b/debian/changelog index 4ef51d952..506047d03 100644 --- a/debian/changelog +++ b/debian/changelog @@ -35,8 +35,10 @@ ikiwiki (2.7) UNRELEASED; urgency=low * Correct generation of RFC 3339 format times for atom/rss feeds. Always use gmtime for these since a time zone is not specified. * Updated Spanish translation from Victor Moral. + * table: Text::CSV doesn't return decoded unicode (XS module); decode its + return values. - -- Joey Hess Tue, 04 Sep 2007 13:30:32 -0400 + -- Joey Hess Tue, 04 Sep 2007 15:19:18 -0400 ikiwiki (2.6.1) unstable; urgency=low