in reply to Inserting UTF-8 on Mysql using DBI

This looks good, assuming that the MySQL SQL program does not (properly) display utf8-encoded characters. Maybe you need to tell the MySQL program that you want the output displayed as utf8, like you did from within Perl? Maybe try retrieving the data back into Perl and displaying it from there or retrieving it from PHP and displaying it there?

Replies are listed 'Best First'.
Re^2: Inserting UTF-8 on Mysql using DBI
by Fox (Pilgrim) on Oct 15, 2010 at 10:53 UTC
    no, the mysql client( from which I got the ????) is fine, as when I execute this insert from PHP I see the japanese characters instead.
    And retrieving the contents from the mysql to the PHP give me the same results as in the client.

      So what did you do to cross check that you're actually receiving and sending utf8 to/from MySQL? What data do you get in Perl when you insert a row using PHP? What data do you get in PHP when you insert a row using Perl? Try to eliminate the mysql client as a potential source of confusion - it might not output utf8 properly (I say without knowing the mysql client well) - the question marks seem to me ignored/escaped unicode characters.

        I found the problem, as it turns out, neither mysql client nor php were using utf8 after all, only perl.. ugh... one thing I still don't understand though is why the characters where being display right on the browser despite the fact the page always had the content-type utf8 header... I guess I understand charset encoding even less now..