use strict; use warnings; use DBI; binmode(STDOUT, ":utf8"); my $dbo = DBI->connect('dbi:mysql:testdb:127.0.0.1:3306','','') or die $!; $dbo->do('SET NAMES utf8'); $dbo->{'mysql_enable_utf8'} = 1; my $str = "\x{72d0}\x{306e}\x{5de5}\x{4f5c}\x{5ba4}"; print "$str\n"; my $s = $dbo->prepare("INSERT INTO test VALUES(?);"); $s->execute($str); #### +-----------------+ | testcol | +-----------------+ | ????? | +-----------------+