#!/usr/bin/perl use strict; use warnings; use utf8; use DBI; use Data::Dumper; my $dbh = DBI->connect("dbi:mysql:database=db1","",""); $dbh->{mysql_enable_utf8} = 1; my $sth = $dbh->prepare('select * from tbl1'); $sth->execute; my $ar = $sth->fetchall_arrayref; $sth->finish; print Dumper( $ar ); binmode(STDOUT, ':utf8'); my $str1 = $ar->[1]->[1]; print qq{"$str1" - }, (utf8::is_utf8($str1) ? 'UTF8' : 'ASCII'), qq{ \n}; my $str3 = $ar->[3]->[1]; print qq{"$str3" - }, (utf8::is_utf8($str3) ? 'UTF8' : 'ASCII'), qq{ \n}; #### $VAR1 = [ [ '0', "\x{e4}\x{f6}\x{fc}\x{df}" ], [ '1', "\x{c6}\x{bc}\x{ae}\x{a9}" ], [ '2', "\x{126}\x{1fe}\x{1fa}\x{1fd}" ], [ '3', 'no unicode' ] ]; "Ƽ®©" - UTF8 "no unicode" - ASCII