summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-11-01 13:14:11 +0100
committerYorhel <git@yorhel.nl>2015-11-01 13:36:24 +0100
commit3c967881d7b5408a49f16de8b268b053d6ba9051 (patch)
treeaa72703bbc1b755cd491070db44e7050e9ea7210
parent3de8d24697511fe324cae2526eb65d6aafb5968b (diff)
DB::(Producers|VN): Convert svg column to perl encoding when fetching
DBD::Pg doesn't recognize the 'xml' data type as textual data, and thus doesn't decode it for us. This fixes the display of non-ASCII characters.
-rw-r--r--lib/VNDB/DB/Producers.pm2
-rw-r--r--lib/VNDB/DB/VN.pm1
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/VNDB/DB/Producers.pm b/lib/VNDB/DB/Producers.pm
index 929e333b..3b6f2a32 100644
--- a/lib/VNDB/DB/Producers.pm
+++ b/lib/VNDB/DB/Producers.pm
@@ -4,6 +4,7 @@ package VNDB::DB::Producers;
use strict;
use warnings;
use Exporter 'import';
+use Encode 'decode_utf8';
our @EXPORT = qw|dbProducerGet dbProducerGetRev dbProducerRevisionInsert|;
@@ -49,6 +50,7 @@ sub dbProducerGet {
$select, $join, \%where,
);
+ $_->{svg} && ($_->{svg} = decode_utf8($_->{svg})) for (@$r);
return _enrich($self, $r, $np, 0, $o{what});
}
diff --git a/lib/VNDB/DB/VN.pm b/lib/VNDB/DB/VN.pm
index 691b0eb3..dba48e23 100644
--- a/lib/VNDB/DB/VN.pm
+++ b/lib/VNDB/DB/VN.pm
@@ -123,6 +123,7 @@ sub dbVNGet {
join(', ', @select), join(' ', @join), \@where, $order,
);
+ $_->{svg} && ($_->{svg} = decode_utf8($_->{svg})) for (@$r);
return _enrich($self, $r, $np, 0, $o{what});
}