I use freetds + unixODBC + php pdo_odbc
to accessMSSQL Server 2012
+ CentOS 7 x86_64
+ freetds version 0.95.19
+ unixODBC version 2.3.4
+ php version 5.6.14
When returning SQL Server results to UTF-8, I get NULL characters (\u0000 in JSON)
in long strings, which when "htmlencoded by JavaScript becomes" ". The only thing I found on the Internet is this post on the FreeTDS mailing list .
By the way, Microsoft ODBC Driver 11 for SQL Server on Linux works fine in this case, but it has some other problems that I could not solve.
UPD: Configurations
/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]
[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
Mizax source
share