Migrating Multibyte Characters from MSSQL sever to MySQL
I am writing PHP scripts to migrate data from Microsoft SQL Server to MySQL, this has been smooth so far, except multibyte characters. can somebody help me to get over with this. What are the points that should be taken care of from PHP and MySQL database perspective.
- Do i have to make some changes in MySQL configuration?
- Do i have to change character encoding in PHP for mul开发者_如何学运维tibyte characters, if yes how?
- Is there anything else i am missing?
Thanks.
I recently added a translation module for our company's website. I did the following to make sure the DB was up for multibyte goodness
- Setting encoding and collation to UTF8
- Make sure your MySQL connection is configured to accept UTF8 characters. You can do this by running the query
SET NAMES utf8
prior to transferring. However, there are other ways to do this (I addedSET NAMES utf8
because that's how I did it.)
The following threads have more info
SET NAMES utf8 in MySQL?
Whether to use "SET NAMES"
精彩评论