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

What to do if Chinese characters are garbled in php sqlserver

藏色散人
Release: 2023-03-12 15:44:02
Original
2056 people have browsed it

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template