in reply to DBI inserting accents

Maybe A UTF8 round trip with MySQL can be of inspiration?

Things to check: did you use utf8;? How are you retrieving the data back from the DB? did you remember to bindmode STDOUT, ':utf8': before printing the returned value? Is the table set up to store text as UTF-8? What character encoding does your terminal use (in which you run the mysql CLI)?

Replies are listed 'Best First'.
Re^2: DBI inserting accents
by packetstormer (Monk) on Mar 21, 2012 at 16:02 UTC
    I have looked at that post but it is not making sense to me to be honest. For example, is says from with a Perl script just "use utf8" then $dbh->do('INSERT INTO test_db.test VALUES(?)', $utf8_string);
    However, if I do this I get this error:
    DBI::db=HASH(0x9eecc70)->do(...): attribute parameter 'Séan' is not a hash ref at insert.pl line 15

    Also, I don't have any problem displaying the text, only inserting.
    I have tried "binmode...." also but I can't get anything to work.
      try adding undef
      $dbh->do('INSERT INTO test_db.test VALUES(?)', undef, $utf8_string);
      poj