It seems like that PMA is ignoring the MySQL connection collation you set or you forgot to use utf8_encode() for example, when displaying values.
How to reproduce:
1) Install a MySQL 5 GA server with default configuration (-> the default charset should be UTF-8)
2) Create a new database (collation latin1)
3) Import the attached sql dump
4) Open your PMA and set the MySQL connection collation to "latin1_swedish_ci"
5) Go to your new database and display the data in the "test" table.
Result: You will see garbled data (also known as "funny" characters; I attached a screenshot of my view)
When you change the encoding in your browser to something like "ISO", the shown data in PMA will be displayed correctly.
I also tested previous versions of PMA. In v3.0.1.1 this is also not working. In v2.11.9.1 it is working...
Contains example sql dump and a screenshot showing the problem
the problem seems to be charset defined in the HTML output (header, meta tag)
we say it is UTF-8 but instead it is latin1 of course
to be more precise: the output coming form the DB is latin, all other is UTF-8
so we need to drop this option an the main.php or convert encoding of all stuff coming form DB
we are discussing this on the dev list
btw. there is no need for changing the connection setting, why do you use it?
use utf-8 connection setting to circumvent this problem
Why did I change the connection setting, a good question. I would answer, "that I learned to do that".
But after your comment, I thought about it and agree with you.
This settings is just important to tell the server, how it should handle the incoming data. But there is no need to do this.
If you want to add data to a latin1 table and you say "set connection to latin1", the mysqld knows that it doesn't need to convert the incoming data, because it should be latin1 data.
If your connection is set to utf-8 and you want to work with latin1 data, the server will convert the incoming data to latin1...
So if I am right, I agree with you, that "we" should remove this option from PMA and just keep working with UTF-8 charset internal... but make sure that you set the connection to UTF-8 and convert user data if needed!
Could you please try out the latest SVN version? The bug should be fixed there.
Thomas,
you can download a snapshot of trunk where the fix has been merged, from
http://cihar.com/phpMyAdmin/snapshots/
Please try it and post your feedback here, thanks.
Hi,
sorry for my late response.
Today I downloaded the latest trunk.
If I now set the MySQL connection collation to "latin1_swedish_ci" and view the test table, the data looks like it should look. No garbled data anymore.
So I would call it fixed.
Thank you.