1

I'm using phpmyadmin for many years but never tried to solve this problem. My database collation is utf8_persian_ci and the table also has the same collation.

While I open phpmyadmin, it doesn't show characters correctly. I see something like برنامه.

In local host I solved this problem by commenting this line:

PMA_DBI_query("SET CHARACTER SET 'utf8';", $link, PMA_DBI_QUERY_STORE);

in /usr/share/phpmyadmin/libraries/database_interface.lib.php but I don't have persmission to do such action in a shared host.

What should I do about this?

NOTE:
The problem is only about PhpMyAdmin. I can see my data correctly when I retrieve them using PHP

Omid
  • 4,575
  • 9
  • 43
  • 74
  • possible duplicate of [Input UTF8 data conveniently to MySQL](http://stackoverflow.com/questions/17857936/input-utf8-data-conveniently-to-mysql) – deceze Dec 20 '13 at 12:39
  • I have tested all these solutions before but the problem still exists. – Omid Dec 20 '13 at 12:51
  • 1
    Have you tested the "solution" that the data in your database is garbage because you're not inserting it correctly?! – deceze Dec 20 '13 at 12:52
  • My database is not garbage. I can retrieve them correctly using PHP. The problem is only about phpmyadmin – Omid Dec 20 '13 at 13:04
  • 3
    Being able to retrieve the correct data via PHP does not automatically mean the data is correctly stored in the database. Take 5 minutes to read what I linked to from the other answer: [Handling Unicode Front To Back In A Web App](http://kunststube.net/frontback/) – deceze Dec 20 '13 at 13:13
  • Yes you're right. I found out the problem was connection charset. Now have to find a solution to convert garbage data. – Omid Dec 20 '13 at 13:17

1 Answers1

1

To convert your "garbage" data, you need to find out in which character set the data is encoded, then code a PHP application that will read the rows, convert the columns with a function like iconv() (http://www.php.net/manual/en/function.iconv.php) and update the rows.

Hint: your PHP application that displays your data correctly, probably generates a page using a certain character set. So use this character set as the input charset of the iconv() function.

Marc Delisle
  • 8,879
  • 3
  • 29
  • 29