Home>Article>Backend Development> What to do if Chinese characters are garbled in php sqlserver

What to do if Chinese characters are garbled in php sqlserver

藏色散人
藏色散人 Original
2021-09-16 09:56:52 1891browse

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.

What to do if Chinese characters are garbled in php sqlserver

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn