Home>Article>Backend Development> What to do if Chinese characters are garbled in php sqlserver
php sqlserver Chinese character garbled solution: 1. Open the freetds configuration file; 2. Add a line of "client charset = UTF8" code in [global]; 3. Restart the PHP environment.
The operating environment of this article: Windows7 system, PHP7.1 version, Dell G3 computer
What should I do if php sqlserver has garbled Chinese characters?
PHP links to sqlserver and Chinese garbled characters appear
PHP connects to sqlserver through the dblib extension, using freetds, and Chinese garbled characters appear.
In the freetds configuration file (/usr/local/freetds/etc/freetds.conf), [global] add the following line
client charset = UTF8
Restart after modification, I am the entire PHP environment All restart.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What to do if Chinese characters are garbled in php sqlserver. For more information, please follow other related articles on the PHP Chinese website!