Utilisation d'UTF8 pour la connexion à la base

tags/0.0.1
Daniel Berteaud 12 years ago
parent bed5b55eb4
commit e093b946bb
  1. 1
      root/usr/bin/samba-db-logd

@ -55,6 +55,7 @@ sub db_connect {
my $dbh = DBI->connect("DBI:mysql:database=$opts{dbname};host=$opts{dbhost}", my $dbh = DBI->connect("DBI:mysql:database=$opts{dbname};host=$opts{dbhost}",
$opts{dbuser}, $opts{dbpass}, {RaiseError => 1}); $opts{dbuser}, $opts{dbpass}, {RaiseError => 1});
die "Couldn't connect to database\n" unless ($dbh); die "Couldn't connect to database\n" unless ($dbh);
$dbh->do("SET NAMES 'UTF8';") or die "Couldn't set names to UTF-8: ".DBI::errstr;
return $dbh; return $dbh;
} }

Loading…
Cancel
Save