summaryrefslogtreecommitdiffstats
path: root/videoadd.pl
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-02-18 02:10:18 +0100
committerGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-02-18 02:10:18 +0100
commit2ba8f6a1439488050b3c98d454f974b2705865be (patch)
tree52a9ecdecb16cf8841e55afa74bcd03353c80371 /videoadd.pl
parent00e7fff759eb267cc2635083a85a6c3db89987fe (diff)
unicode bugfix
Diffstat (limited to 'videoadd.pl')
-rwxr-xr-xvideoadd.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/videoadd.pl b/videoadd.pl
index c5f38b7..ce68ef3 100755
--- a/videoadd.pl
+++ b/videoadd.pl
@@ -23,6 +23,7 @@ use File::Spec::Functions;
use File::Copy qw /move/;
use Env qw /HOME/;
use Switch qw /Perl6/;
+use utf8;
use strict;
################################################################################
@@ -317,6 +318,13 @@ if ( defined($file) ) {
$new{customs}->{subtitles} = lc join (', ', @slang);
}
+# Convert everything to UTF-8
+map { utf8::encode($new{$_}) if exists $new{$_} and not utf8::is_utf8($new{$_}) }
+ qw/title subtitle language diskid comment disklabel imgurl director
+ actors country filename plot/;
+map { utf8::encode($_) unless utf8::is_utf8($_) } (values %{$new{customs}});
+map { utf8::encode($_) unless utf8::is_utf8($_) } @{$new{genres}};
+
################################################################################
# Insertion into the database