From c8f9e3aa4ffd44d4cdf750e239325a4295c509cd Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 28 Feb 2012 21:43:52 +0100 Subject: unicode, cont --- videoadd.pl | 5 ++--- videodb-check.pl | 3 +-- videodb.rc | 1 + videomv.pl | 4 +--- videorm.pl | 4 +--- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/videoadd.pl b/videoadd.pl index d76ad14..bb70614 100755 --- a/videoadd.pl +++ b/videoadd.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -w -CADSL # This program is free software. It comes without any warranty, to the # extent permitted by applicable law. You can redistribute it and/or @@ -241,7 +241,6 @@ unless ( defined $ignoredb_flag ) { } $dbh = DBI->connect($dsn, $config{user}, $config{password}) or die "Error: Can't connect do database.\n"; - $dbh->do( "SET NAMES UTF8" ) or die "Error: Can't set names to UTF-8.\n"; } my $id; @@ -290,7 +289,7 @@ if ( defined ($imdb{crit}) and &runIMDB() ) { # Got a single result; Process the movie $new{title} = $movie->title(); $new{language} = lc join (', ', @{$movie->language()}); - $new{imdbid} = 'imdb:' $movie->id(); + $new{imdbid} = 'imdb:' .$movie->id(); $new{year} = $movie->year(); $new{imgurl} = $movie->cover(); $new{director} = join ', ', map {$_->{name}} @{$movie->directors()}; diff --git a/videodb-check.pl b/videodb-check.pl index bf45d6b..cd0baa3 100755 --- a/videodb-check.pl +++ b/videodb-check.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -w -CADSL # This program is free software. It comes without any warranty, to the # extent permitted by applicable law. You can redistribute it and/or @@ -143,7 +143,6 @@ if (defined $config{dbi_misc}) { } my $dbh = DBI->connect($dsn, $config{user}, $config{password}) or die "Can't connect do database\n"; -$dbh->do( "set names utf8" ) or die; ################################################################################ diff --git a/videodb.rc b/videodb.rc index 94a938f..032bded 100644 --- a/videodb.rc +++ b/videodb.rc @@ -11,6 +11,7 @@ user => 'username', # Optional extra connection options dbi_misc => { mysql_ssl => 1 , mysql_ssl_ca_file => "/etc/ssl/certs/cacert.org.pem" + , mysql_enable_utf8 => 1 }, password => '******', prefix => 'videodb_', diff --git a/videomv.pl b/videomv.pl index e4c2a14..456da76 100755 --- a/videomv.pl +++ b/videomv.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -w -CADSL # This program is free software. It comes without any warranty, to the # extent permitted by applicable law. You can redistribute it and/or @@ -388,8 +388,6 @@ unless (defined $ignoredb_flag) { } $dbh = DBI->connect($dsn, $config{user}, $config{password}) or die "Can't connect do database"; - $dbh->do( "set names utf8" ) or die; - # Lookup for the file in the videodb database $RES = diff --git a/videorm.pl b/videorm.pl index 228317d..dceff84 100755 --- a/videorm.pl +++ b/videorm.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -w -CADSL # This program is free software. It comes without any warranty, to the # extent permitted by applicable law. You can redistribute it and/or @@ -170,8 +170,6 @@ if (defined $config{dbi_misc}) { } my $dbh = DBI->connect($dsn, $config{user}, $config{password}) or die "Can't connect do database.\n"; -$dbh->do( "set names utf8" ) or die; - # Lookup for the file in the videodb database my $res = $dbh->selectall_arrayref ( "SELECT id FROM $config{prefix}videodata WHERE filename = ?", -- cgit v1.2.3