in reply to Re: Can't write cyrillic to DBD::mysql
in thread Can't write cyrillic to DBD::mysql

Definitely utf8, I checked the code with Devel::Peek, forwarded it in an email and put it back into an utf8 coded web page.
  • Comment on Re^2: Can't write cyrillic to DBD::mysql

Replies are listed 'Best First'.
Re^3: Can't write cyrillic to DBD::mysql
by Corion (Patriarch) on Jun 29, 2010 at 10:39 UTC

    Checking with Devel::Peek will only tell you whether Perl thinks that the string is encoded as utf8. I would print the output and then pipe it through hexdump or od -x to really see what octets are output.

    But if the data really is utf8, then the culprit seems to be DBD::mysql and how it handles/accepts utf8. Are you using placeholders?

      Devel::Peek dumps the string too; before trusting Devel::Peek I wrote my own hexdump, but the data stays the same :-)

      I tried doing just a 'dbh->do(sql) and a dbh->do(sql, undef, @placeholder). The result is the same: The cyrillic characters are replaced by '?'.
      Same effect happens with greek Characters, Xilman was supecting that everything not in code block 01 of utf might fail.

      Wolfgang

        My guess, which is totally not based on any facts, is that your table/column stores its data in Latin-1, even though you can send/receive the data in utf8. I don't know enough about MySQL to know whether that's a possibility though, so take this with a large grain of salt.