diff options
author | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-02-18 02:10:18 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-02-18 02:10:18 +0100 |
commit | 2ba8f6a1439488050b3c98d454f974b2705865be (patch) | |
tree | 52a9ecdecb16cf8841e55afa74bcd03353c80371 | |
parent | 00e7fff759eb267cc2635083a85a6c3db89987fe (diff) |
unicode bugfix
-rwxr-xr-x | videoadd.pl | 8 |
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 |