summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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