Woohoo! I think I've found it! I'm still testing a few things but so far it seems to be working.

I noticed that the variable containing the UTF chars was decoded using utf8::decode() without first checking it with utf8::is_utf8(). It turns out that it was already decode()ed, so I was in fact double decode()ing. This seems to just remove the utf8 attribute and somehow put it in a very wierd sometimes UTF8/sometimes not UTF8 state.

Anyway, I've corrected this now and it seems to be working.

What *should* happen to a double decode()ed string? I would have thought that nothing would happen, but clearly that's not the case. I guess this is just a usage error.

Any ideas why a double decode()ed string works fine where prepare()ed, but not when sent as an execute() argument?

Cheers guys. I really appreciate your masterful help!

MattLG


In reply to Re^3: UTF8 execute() parameters (DBI) by MattLG
in thread UTF8 execute() parameters (DBI) by MattLG

Title:
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, details, 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, summary, 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.