Jump to content

Recommended Posts

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.

 

 

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.

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.

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..

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/

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.