Php connection mssql database Chinese garbled problem a piece of code (query mssql database) can normally output Chinese on one server, transferred to another server, query the database to retrieve Chinese garbled characters, English numbers are normal, I would like to ask you how to modify this to make it normal ...??? ------ Solution -------------------- commonly used utf8-general-ci is not only the table to be unified, to be unified a total of four is: php connection mssql database Chinese garbled problem
A piece of code (querying the mssql database) can normally output Chinese characters on one server and be transferred to another server. the Chinese characters obtained from the database are garbled and English numbers are normal. could you please tell me, how can this problem be changed to be normal ...???
------ Solution --------------------
Coding commonly used is utf8-general-ci
Not only tables must be unified, but a total of four tables must be unified.
First, the database types, including databases, tables, and fields, must be unified. check the fields.
Second, the file encoding type. if you use dw or editplus, you can view the page encoding.
Third, set NAMES utf8 when accessing the database;
4. add the meta attribute in the browser display mode.
No matter how GBK or GB2312 is used, the steps must be unified.
------ Solution --------------------
The local codes of the two servers are different !~~~~~ Check whether the local encoding is the same as saving it in Notepad and then checking whether the encoding is the same !~~
------ Solution --------------------
Http://blog.csdn.net/xiaowall/article/details/7864343
------ Solution --------------------
You cannot directly connect to SQL server from linux. check whether the configuration of the connection tool is appropriate.
Since one server performs normally, it is not difficult to compare the settings.
If you try to solve the problem in php, you must at least give the original string of "garbled" (remember to use base64 encoding to avoid information loss)