PHP Connection MSSQL Database Chinese garbled related problems
Source: Internet
Author: User
PHP Connection MSSQL Database Chinese garbled problem
A piece of code (query MSSQL database) on a server can normally output Chinese, transferred to another server, query the database out of Chinese garbled, the English number is normal, I ask you, this need how to modify to normal ...???
------Solution--------------------
Coding is commonly used in UTF8-GENERAL-CI
Not only the table to unify, to unify the total common all around
One is: The database type, which includes, database, table, fields are unified three, you can check
The second is: the file encoding type, if you use DW or editplus can see the page encoding, different need to modify
The third is: when accessing the database settings are set NAMES UTF8;
Four: Browser display mode, add meta attribute
No matter with gbk,gb2312, this must be unified everywhere, see you missing a step
------Solution--------------------
The local encoding of the two servers is different! ~~~~~ to see the local code write directly with Notepad Save as then look at the code is not the same! ~~
------Solution--------------------
http://blog.csdn.net/xiaowall/article/details/7864343
------Solution--------------------
Do not connect directly to SQL Server from Linux, first check the connection tool configuration is appropriate
Since one is behaving normally, it should not be difficult to compare the settings
If you try to solve the problem in PHP, then at least you need to give "garbled" the original string (remember to use Base64 encoding, so as not to lose information)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service