http://www.perlmonks.org?node_id=1011503


in reply to Re: Encoding issue from DBI to string
in thread Encoding issue from DBI to string

"The use of placeholders is absolutely vital when using SQL..."

Nothing but the truth. But perhaps this is yet another communication problem.

I'm just wondering about what will happen when i try to force mysql_enable_utf8 => 1 in my DBI call when default-character-set=utf8 and default-collation=utf8_unicode_ci is not set in my.cnf...

For the moment i don't have any mySQL at the hand to check this.

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re^3: Encoding issue from DBI to string
by ev0lution (Initiate) on Jan 03, 2013 at 20:57 UTC
    Even after adding in the default-collation=utf8_unicode_ci, I'm still getting all question marks for multibyte characters. What a headache.

    Not sure if anyone who have the answer here, but assuming the DB is set up appropriate with all UTF-8 encoding and data appearing valid in the tables, it wouldn't really matter how it's getting into the database to begin with, right?

    We're using a 3rd party program as a scraper, and its underlying Java is dumping the data to the DB. I haven't looked into it much just because the data appears right in the DB with all UTF-8 encoding configured, so I assumed it wasn't the issue.

      "Even after adding in the default-collation..."

      S**t!

      "...it wouldn't really matter how it's getting into the database to begin with, right?

      To be honest, i'm not shure about this.

      BTW, what happens if you fire up your query using mysql client?

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

Re^3: Encoding issue from DBI to string
by ev0lution (Initiate) on Jan 03, 2013 at 20:06 UTC
    Hey Karl, Upon looking in the my.cnf file, I had default-character-set = utf8 and collation-server = utf8_unicode_ci, however default-collation was not set. I made the necessary changes, but had to step into a meeting. I'll take a look at how things go in a bit.