SuperBlue Posted May 3, 2011 Share Posted May 3, 2011 I recently discovered doing a checkup in phpMyAdmin, that i couldn't enter danish letters directly from phpMyAdmin, and still have them show up correctly on my site. I suspect it must be a server configuration, or bug with phpMyAdmin it self. Isn't UTF-8 supposed to support these letters, without having to use their HTML entities? The problem is.. I can post these characters in comments from the website, and they will also show up correctly. But then they will be messed up when viewed from within phpMyAdmin. The really strange part is, when i submit these characters from phpMyAdmin, then it will be the other way around, and they will just show up as � when viewed on the website. The MYSQL default character set is UTF-8, inside of my.ini. And i also tried to change the Collation of the table, and the effected field from latin1_swedish_ci to utf8_general_ci, which made no difference whatsoever. Quote Link to comment https://forums.phpfreaks.com/topic/235394-phpmyadmin-and-special-danish-letters-%C3%A6%C3%B8%C3%A5/ Share on other sites More sharing options...
SuperBlue Posted May 3, 2011 Author Share Posted May 3, 2011 I just successfully validated content submitted from the website, wheres the content that i submitted from phpMyAdmin fails validation. Sorry, I am unable to validate this document because on line 36 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication. The error was: utf8 "\xC6" does not map to Unicode So i must have missed a setting for phpMyAdmin somewhere. Quote Link to comment https://forums.phpfreaks.com/topic/235394-phpmyadmin-and-special-danish-letters-%C3%A6%C3%B8%C3%A5/#findComment-1209727 Share on other sites More sharing options...
Zane Posted May 3, 2011 Share Posted May 3, 2011 Here's some useful links http://www.denmarkfacts.com/unicode.html http://www.cs.tut.fi/~jkorpela/chars/sorted.html#NS_4551-1 http://www.faqs.org/rfcs/rfc1345.html http://quae.nl/rfc1345.html Quote Link to comment https://forums.phpfreaks.com/topic/235394-phpmyadmin-and-special-danish-letters-%C3%A6%C3%B8%C3%A5/#findComment-1209728 Share on other sites More sharing options...
SuperBlue Posted May 3, 2011 Author Share Posted May 3, 2011 I'm not sure how those links should help me, mostly they contain stuff i already know (never mind the specifics, who cares about that anyway). What i want to know, is why phpMyAdmin submits the data in a wrong character set. I even tried to force my Browser to use UTF-8, but phpMyAdmin will still submit in the wrong format. I also checked in the /setup directory, and it was correctly set to use UTF-8, its also setup to use UTF-8 for MySQL connection collation. I'm not sure where else to check. And I've verified that the data that I'm submitting from my own scripts is valid UTF-8. I only got a problem with phpMyAdmin. Quote Link to comment https://forums.phpfreaks.com/topic/235394-phpmyadmin-and-special-danish-letters-%C3%A6%C3%B8%C3%A5/#findComment-1209731 Share on other sites More sharing options...
SuperBlue Posted May 3, 2011 Author Share Posted May 3, 2011 Just located some information, which might be relevant. http://wiki.phpmyadmin.net/pma/garbled_data Turns out they had an old closed bug report, where this link was posted. Maybe I'll find a solution there. Quote Link to comment https://forums.phpfreaks.com/topic/235394-phpmyadmin-and-special-danish-letters-%C3%A6%C3%B8%C3%A5/#findComment-1209734 Share on other sites More sharing options...
SuperBlue Posted May 3, 2011 Author Share Posted May 3, 2011 Ok i found a solution to my problem, I'm almost sure that this is a bug in phpMyAdmin. In any case, what i did to solve the problem, was to follow a suggestion posted on this forum http://www.developpez.net/forums/d105647-2/php/outils/phpmyadmin/utf-8-phpmyadmin-problemes-dencodage/ I can't quite make out what these people are saying, but i understood the "Merci" part, so I'll better pick up that French book again sometime. Anyway, a modification to mysql.dbi.lib.php was needed, and i just inserted the below, just before "return $link;" in the PMA_DBI_connect function. The mysql.dbi.lib.php file is located in libraries/dbi. mysql_query("SET SESSION CHARACTER_SET_RESULTS =latin1;",$link); mysql_query("SET SESSION CHARACTER_SET_CLIENT =latin1;",$link); I hate using code i don't understand, and i don't understand why they would set the character set to latin1, when its utf8 they want. But in any case, phpMyAdmin seems to be correctly saving data in UTF-8 now, and i got the desired output, so i guess this is solved, for now.. Quote Link to comment https://forums.phpfreaks.com/topic/235394-phpmyadmin-and-special-danish-letters-%C3%A6%C3%B8%C3%A5/#findComment-1209746 Share on other sites More sharing options...
gizmola Posted May 3, 2011 Share Posted May 3, 2011 It's really odd that these types of questions seem to come in waves. Somehow I missed yours, but I just answered a very similar problem. You definately want to read this: http://omegadelta.net/2010/11/23/when-you-thought-the-db-was-utf-8-but-it-wasnt/ Quote Link to comment https://forums.phpfreaks.com/topic/235394-phpmyadmin-and-special-danish-letters-%C3%A6%C3%B8%C3%A5/#findComment-1209801 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.