PHP uses dblib extension to connect to sqlserver Chinese garbled problem

When using php to link to sqlserver, the data queried, the encoding is unstable, utf8 for a while, and a question mark for a while. Very confused. The following method can solve this problem. The premise is the dblib extension.

 

If the result found is garbled, the change /usr/local/freetds/etc/freetds.confwill add an entry to global

  1. client charset = UTF8

Remember to restart after modification.

 

 

{{o.name}}
{{m.name}}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324038910&siteId=291194637