phpMyAdmin and utf8

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

phpMyAdmin and utf8

Postby pir » 13. December 2010 17:27

Hi!

I'm really stuck with utf8 problems. I want to store utf8 encoded strings in a database table. The way I'm doing this is by running a script that writes to a table that is created with 'CHARACTER SET utf8 COLLATE utf8_unicode_ci' as field settings. I've tried a lot of different settings. When running from terminal or browser, the characters åäö shows correctly. It also seems to be displayed correctly when I'm fetching the values from the table and writing them to the browser or terminal. The problem is that when I look at my values with phpMyAdmin, the characters 'åäö' is shown as if they were inserted with incorrect encoding. This is starting to drive me nuts. I can't see any logic in this, since both the browser and my terminal is displaying 'åäö' correctly and they are both set to UTF-8. Is phpMyAdmin using some settings that doesn't care what encoding the tables are using? I've seen that there are a 'variables' page in phpMyAdmin where there it says 'character set results': utf8 (Global value latin-1).

Might also add that my editor is set to utf8 and when I hardcode 'åäö' to all fields, they are only displayed correctly in phpMyAdmin if I use utf8_decode on them before storing the strings to the table. The strings show correctly if I call mysql_query( "SET NAMES 'utf8'"); when I'm connecting to the database before inserting my values... Which makes me more confused.




Really hope someone has an answer to my problem

thanks
pir
pir
 
Posts: 5
Joined: 30. November 2010 11:28

Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 2 guests