我似乎无法使用 FreeTDS 扩展从编码为 UTF-8 的 MSSQL 获取数据。
连接:
ini_set('mssql.charset', 'UTF-8');
$this->_resource = mssql_connect($config['servername'], $config['username'], $config['password']);
我无法使用任何其他扩展。
我试过创建 ~/.freetds.conf
[global]
client charset = UTF-8
我试过将参数传递给php:
php -d mssql.charset="UTF-8" index.php
数据仍然不是 UTF-8。
php -i
mssql
MSSQL Support => enabled
Active Persistent Links => 0
Active Links => 0
Library version => FreeTDS
Directive => Local Value => Master Value
mssql.allow_persistent => On => On
mssql.batchsize => 0 => 0
mssql.charset => no value => no value
mssql.compatability_mode => Off => Off
mssql.connect_timeout => 5 => 5
mssql.datetimeconvert => On => On
mssql.max_links => Unlimited => Unlimited
mssql.max_persistent => Unlimited => Unlimited
想法?