
ev0lution37
Novice
Jan 3, 2013, 8:20 AM
Post #1 of 4
(5471 views)
|
Encoding issue from DBI to string
|
Can't Post
|
|
I'm pretty stumped. I'm pulling from a MySQL database using DBI, however I'm getting junk when I dump it to an array. Here's the code:
my $dbh = DBI->connect("DBI:mysql:$db_name1:$db_host1:$db_port1","$db_user1","$db_pw1", {RaiseError => 1, PrintError => 0, mysql_enable_utf8 => 1, ChopBlanks =>0}); $log->debug("Running SQL Select statement: $sqlselect" . "\n"); my $RowSet = $dbh->selectall_arrayref("SELECT * FROM CollectionDB.ISIS WHERE SourceID = '$PassedSource' ORDER BY ObjectKey DESC"); Now, after that I set each element of the array to a set of strings, then run data_string_desc on them. This is the result:
artTitle is ?????? ?? ??? ???? ???? ???? Encoding test on Title results: UTF8 off, ASCII, 28 characters 28 bytes I'm not sure how, even with UTF-8 enabled while DBI is connecting to the DB and UTF-8 set for every configuration on the database itself, the string is still appearing as ASCII. I need the UTF-8 because a majority of the data I'm bringing in is multibit (Chinese, Arabic, etc..) Thanks in advance for any insight you can providE!
|