Jump to content

Mysql Encoding Change


Recommended Posts

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


Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.