Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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_utf +8 => 1, ChopBlanks =>0}); $log->debug("Running SQL Select statement: $sqlselect" . "\n"); my $RowSet = $dbh->selectall_arrayref("SELECT * FROM CollectionDB.ISI +S 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 byte +s

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!

In reply to Encoding issue from DBI to string by ev0lution

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (5)
    As of 2018-02-18 18:47 GMT
    Find Nodes?
      Voting Booth?
      When it is dark outside I am happiest to see ...

      Results (256 votes). Check out past polls.