From 8489e68916eabf0ce09242e4dac66b9f646d46c4 Mon Sep 17 00:00:00 2001
From: joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Date: Wed, 5 Sep 2007 17:22:26 +0000
Subject: [PATCH] * table: Text::CSV doesn't return decoded unicode (XS
 module); decode its   return values.

---
 IkiWiki.pm              | 2 +-
 IkiWiki/Plugin/table.pm | 3 ++-
 debian/changelog        | 4 +++-
 3 files changed, 6 insertions(+), 3 deletions(-)

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 <joeyh@debian.org>  Tue, 04 Sep 2007 13:30:32 -0400
+ -- Joey Hess <joeyh@debian.org>  Tue, 04 Sep 2007 15:19:18 -0400
 
 ikiwiki (2.6.1) unstable; urgency=low
 
-- 
2.39.5