http://www.perlmonks.org?node_id=960790

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:

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'");
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.
Does anyone have any suggestions?
BTW, if I connect to MySQL CLI and run a manual insert the string "Séan" inserts and displays fine.