sandeep_india Posted November 7, 2008 Share Posted November 7, 2008 Hi all, I m using PHP Version 4.3.2 & Mysql version 3.23.58 (No collation etc). My site is in shift JIS encoding and all the data is in shift JIS. Now I want to convert it to UTF-8 encoding. so that all the old data readable in UTF-8 encoding. Is it possible. Pls help me cause its very important. Thanks in advance. With Regards Sandeep Quote Link to comment https://forums.phpfreaks.com/topic/131753-mysql-encoding-change/ Share on other sites More sharing options...
haku Posted November 10, 2008 Share Posted November 10, 2008 Have you tried just switching the encoding on the database? You can do this through phpmyadmin. It may screw up your data though, because the data inside the database may not be re-encoded under the new charset when you switch it. So back up your database before trying, and if it doesn't work, just restore the backup you took. If you try it out and it doesn't work, you could write a script that would extract the data from the database, re-code it in UTF-8, and drop it in a new UTF-8 encoded database with the same structure as the old one. Then delete the old database, and re-name the new one to whatever the old one was called. Kind of a pain in the ass, but it should work. Again, back up your data first. As a side note though, if your site is Japanese, then you should probably stick with Shift-JIS, or switch to EUC_JP, as they are both better than UTF-8 for Japanese language sites. But if it's a site in another language that also has Japanese, then ya, UTF-8 is the way to go. Quote Link to comment https://forums.phpfreaks.com/topic/131753-mysql-encoding-change/#findComment-686591 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.