]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Fix table plugin can handle UTF-8 csv format
authorFeng Shu <tumashu@163.com>
Sun, 2 Dec 2018 00:41:39 +0000 (08:41 +0800)
committerSimon McVittie <smcv@debian.org>
Thu, 31 Jan 2019 20:37:06 +0000 (20:37 +0000)
IkiWiki/Plugin/table.pm

index f3c425a37dacd9d1389f0c53a0d7fbc52469c70b..7fea8ab1c2112d98e9d2d6c309b0a69ea3aac31c 100644 (file)
@@ -135,6 +135,7 @@ sub split_csv ($$) {
        my $csv = Text::CSV->new({ 
                sep_char        => $delimiter,
                binary          => 1,
+               decode_utf8 => 1,
                allow_loose_quotes => 1,
        }) || error("could not create a Text::CSV object");
        
@@ -143,7 +144,7 @@ sub split_csv ($$) {
        foreach my $line (@text_lines) {
                $l++;
                if ($csv->parse($line)) {
-                       push(@data, [ map { decode_utf8 $_ } $csv->fields() ]);
+                       push(@data, [ $csv->fields() ]);
                }
                else {
                        debug(sprintf(gettext('parse fail at line %d: %s'),