Skip to content
Snippets Groups Projects
Commit 0d88b1e6 authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

add option to turn utf8 mode on

parent abcaa656
Branches
No related tags found
No related merge requests found
...@@ -29,8 +29,20 @@ sub connect ...@@ -29,8 +29,20 @@ sub connect
my $db_con= join (':', 'dbi', $adapter, map { $self->{$_} } qw(database host)); my $db_con= join (':', 'dbi', $adapter, map { $self->{$_} } qw(database host));
# print "db_con=[$db_con]\n"; # print "db_con=[$db_con]\n";
$dbh= DBI->connect($db_con, map { $self->{$_} } qw(username password)); $dbh= DBI->connect($db_con, map { $self->{$_} } qw(username password));
# print "dbh=[$dbh]\n"; # print "dbh=[$dbh]\n";
if (exists ($self->{encoding}))
{
if ($self->{encoding} eq 'utf8')
{
# print __FILE__, ' ', __LINE__, " NOTE: turning on utf8 mode in MySQL driver\n";
$dbh->{mysql_enable_utf8}= 1;
$dbh->do('set names utf8');
}
}
$self->{'_dbh'}= $dbh; $self->{'_dbh'}= $dbh;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment