This is a discussion on mySQL and language encoding within the MySQL Database forums, part of the Database Forums category; I am using mySQL 4.1.21-standard, phpMyAdmin version 2.10.1. I am storing Japanese data. I have ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am using mySQL 4.1.21-standard, phpMyAdmin version 2.10.1. I am
storing Japanese data. I have one table that has data stored in EUC-JP encoding which is using Latin1_swedish_ci as the collation (it also includes rows with English data). The data in this table was populated via an HTML interface (the pages all specify EUC-JP as the encoding the browser should use). The data in this table is scrambled when I view the data in phpMyAdmin (regardless of testing different browser encoding settings). I also cannot export the data from phpMyAdmin into any usable form. Despite not playing well with phpMyAdmin, it looks fine in a broswer with pages produced from a PHP web application (that doesn't do anything special in terms of encoding). I have another table that I am trying to populate with CSV data with EUC-JP encoding. If I set the field collation to ujis, I can import the data into the mySQL database through phpMyAdmin. I specify the source data is EUC-JP and everything runs smoothly and the Japanese data will display correctly in phpMyAdmin (If the collation is set to Latin1_ the data is all ????? in both phpMyAdmin and from a PHP produced page, so I am forced to choose ujis as the collation setting of the field with Japanese). Of note, the browser encoding setting when veiwing the data in phpMyAdmin is UTF-8, not EUC-JP. Despite being viewable in phpMyAdmin, the Japanese will not display correctly from my HTML page that displays the data regardless of the encoding I select in the browser (it is all ??????'s). However, if from the HTML page I edit and save a row with Japanese, the PHP produced page with display the Japanese correctly in EUC-JP encoding. It also looks scrambled in phpMyAdmin in the same way as the data in the first table I describe above. It appears that regardless of the collation settings in the tables, I am somehow able to correctly store and retreive Japanese data in EUC- JP encoding as long as I submit the data from a web form and retreive it from a web form. If I try to use phpMyAdmin to import/export data or view data, it seems to be impossible to correctly display the data but still display the Japanese correctly on my PHP pages. This is a problem because if I want to dump the data from my tables with phpMyAdmin I can't get at it, nor can I add new data to my database using phpMyAdmin. I do have the multibyte PHP string functions installed, by the way. Please help me understand what is going on and how I can get data into and out of my database in the correct EUC-JP encoding. |