<?xml version="1.0" encoding="windows-1252"?>
<node id="1011485" title="Encoding issue from DBI to string" created="2013-01-03 11:28:19" updated="2013-01-03 11:28:19">
<type id="115">
perlquestion</type>
<author id="1002973">
ev0lution</author>
<data>
<field name="doctext">
&lt;p&gt;
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:
&lt;/p&gt;

&lt;code&gt; 
my $dbh = DBI-&gt;connect("DBI:mysql:$db_name1:$db_host1:$db_port1","$db_user1","$db_pw1", {RaiseError =&gt; 1, PrintError =&gt; 0, mysql_enable_utf8 =&gt; 1, ChopBlanks =&gt;0}); 
 
 $log-&gt;debug("Running SQL Select statement: $sqlselect" . "\n"); 
 
 my $RowSet = $dbh-&gt;selectall_arrayref("SELECT * FROM CollectionDB.ISIS WHERE SourceID = '$PassedSource' ORDER BY ObjectKey DESC");

&lt;/code&gt;

&lt;p&gt;
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:
&lt;/p&gt;

&lt;code&gt;
artTitle is ?????? ?? ??? ???? ???? ???? 
Encoding test on Title results: UTF8 off, ASCII, 28 characters 28 bytes
&lt;/code&gt;

&lt;p&gt;
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..)
&lt;/p&gt;

&lt;p&gt;
Thanks in advance for any insight you can provide!
&lt;/p&gt;</field>
</data>
</node>
