packetstormer has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks
I am having difficulty inserting characters into MySQL with accents e.g "Séan"
I have both the MySQL server/client set to use UTF8 and also the DBI connection has the following:
I have also tried decoding the string before the insert like: $case_header = Encode::decode_utf8($case_header); But that inserts a very strange character in the DB.my $dbh= DBI->connect("DBI:$db_driver:dbname=$db_name;host=$db_hos +t;port=$db_port", $db_user, $db_passwd,{RaiseError=>1}); #or die $DBI::errstr; $dbh->{'mysql_enable_utf8'}=1; $dbh->do("set NAMES 'utf8'");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI inserting accents
by moritz (Cardinal) on Mar 21, 2012 at 15:46 UTC | |
by packetstormer (Monk) on Mar 21, 2012 at 16:02 UTC | |
by poj (Abbot) on Mar 21, 2012 at 17:08 UTC | |
|
Re: DBI inserting accents
by moritz (Cardinal) on Mar 21, 2012 at 18:56 UTC | |
|
Re: DBI inserting accents
by Ralesk (Pilgrim) on Mar 22, 2012 at 10:51 UTC |