Hello,
I have been experiencing a problem that phpmyadmin does not encode the data to chosen charcter set when exporting as CSV file by export.php.
It's not only CSV format but perhaps all of kind of format available on export.php.
My database MySQL5.1 is set to use UTF-8 as its character set and I use Japanese character incuding Kanji. I can see them correctly on phpmyadmin when I execute SQL on it but when exporting the result of a query to a file they get corrupted.
Adding "'knjenc'," into the array $post_params will fix this problem.
"$GLOBALS['knjenc']" is needed on line 336 of export.php to encode SQL query result into the user choice encoding but it it not in the array "$GLOBALS" as it is not in the array "$post_params".
I would like you to confirm this is the right way of fixing this problem and put same kind of fix in the near future release if possible.
Best regards,
Yukihisa Kitagawa
Hi Yukihisa,
First of all I must tell you that my knowledge on Japanese encoding is very minimal.
But looking at the code, if you chose Japanese as phpMyAdmin's interface language and then try to export a table you should see a couple of radio buttons to chose the correct encoding at the bottom of Export page.
Can you do that and see whether the problem still persists.
Hello Madhura,
Thank you for your quick responce.
Yes. When I choose Japanese as phpMyAdmin's interface language I see a couple of radio buttons which are 'none','EUC','SJIS'.
I chose SJIS to export UTF-8 coded data expecting the data will be exported SJIS encoded but I got UTF-8 coded data.
so I did some investigation to the export.php and the Export page.
at the Export page, when I use japanese as its language I can see those html code.
This means export.php need to recognize the value I chose by the radio buttons with the name "knjec" and the value whatever I choose.
Now I look at export.php.
this code shows that POSTed values are put into the array '$GLOBALS', and the array key is taken from the array called "$post_params".
in this case the array "$post_params" has to have 'knjenc' as its value otherwise $GLOBALS won't have the value posted from the Export page named 'knjenc'.
the value "$GLOBALS['knjenc']" is needed on line 336 of export.php.
this is what I have found.
thanks,
Last edit: Yukihisa Kitagawa 2014-02-03
Fixed with https://github.com/phpmyadmin/phpmyadmin/commit/ceecaa41c1506dbba576e1371902ae1a23ddefc1
Thank you for fixing the problems!
Regards,
Yukihisa