I'm using freetds + unixODBC + php pdo_odbc
to access MSSQL Server 2012
+ CentOS 7 x86_64
+ freetds version 0.95.19
+ unixODBC version 2.3.4
+ php version 5.6.14
When retreiving results from SQL Server in UTF-8 I get NULL characters (\u0000 in JSON)
in long strings, which, when htmlencoded by JavaScript becomes "�".
The only thing I've found in the internet is this post in FreeTDS mailing list.
By the way, Microsoft ODBC Driver 11 for SQL Server on Linux works fine in this case, but has some other issues I could not solve.
UPD: Configs
/etc/freetds.conf
[global]
text size = 2147483647
[ibmMSSQL]
host = ibm.sevkav.local
port = 49927
tds version = 7.3
client charset = UTF-8
/etc/odbc.ini
[ODBC Data Sources]
[ibmMSSQL]
Description = MSSQL Server
Trace = No
Servername = ibmMSSQL
Database = MRS
[ibmMSSQLnative]
Driver = SQL Server Native Client 11.0
Description = Test MS Driver
Trace = no
Server = ibm.sevkav.local,49927\EAIS_MIRROR
Database = MRS
[Default]
Driver = FreeTDS
/etc/odbcinst.ini
[ODBC]
#DEBUG=1
#TraceFile=/tmp/sqltrace.log
#Trace=Yes
[PostgreSQL]
Description=ODBC for PostgreSQL
Driver=/usr/lib/psqlodbcw.so
Setup=/usr/lib/libodbcpsqlS.so
Driver64=/usr/lib64/psqlodbcw.so
Setup64=/usr/lib64/libodbcpsqlS.so
FileUsage=1
[MySQL]
Description=ODBC for MySQL
Driver=/usr/lib/libmyodbc5.so
Setup=/usr/lib/libodbcmyS.so
Driver64=/usr/lib64/libmyodbc5.so
Setup64=/usr/lib64/libodbcmyS.so
FileUsage=1
[FreeTDS]
Description=ODBC for FreeTDS
Driver64=/usr/lib64/libtdsodbc.so.0
FileUsage=1
client charset = utf-8
[SQL Server Native Client 11.0]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=/usr/lib64/libsqlncli-11.0.so.1790.0
Threading=1
UsageCount=1