[freetds] diacritics issue

Santen van, JDG (Jos) Jos.van.Santen at rabobank.nl
Thu Aug 18 02:28:04 EDT 2016


I am facing an issue with diacritics.
I am running MS SQL Enterprise x64 version 11.0.6523.0, created a table there with a colomn type varchar(100) and nvarchar(100)
Stored the string: 蚞ȊŽàâçèéêëîïôùûüÀÂÇÈÉÊËÎÏÔÙÛÜáíóúñÁÍÓÚÑäöÄÖğışĞIŞ in both fields.

Codepage is 1252 latin and server collation is Latin1_General_CI_AS
The table is using the servers defaults.

Using FreeTDS driver 0.91, defined protocol version 7.0 in the freetds config, the data retrieved by the client is corrupted, the šž  (9a 9e) and ŠŽ (8a 8e) aren’t viewable in our client and returned  ‘blanks’ (actually the 9a 9e and 8a 8e aren’t visible in our client), the ğışĞIŞ is returned as gisGIS (67 69 73 47 49 53)

The returned hex values of the complete string for both field types is the same:
63 9a 9e 43 8a 8e e0 e2 e7 e8 e9 ea eb ee ef f4 f9 fb fc c0 c2 c7 c8 c9 ca cb ce cf d4 d9 db dc e1 ed f3 fa f1 c1 cd d3 da d1 e4 f6 c4 d6 67 69 73 47 49 53

A part of the debug log related to character conversion:
iconv.c:330:tds_iconv_open(0x1891400, UTF-8)
iconv.c:187:local name for ISO-8859-1 is ISO-8859-1
iconv.c:187:local name for UTF-8 is UTF-8
iconv.c:187:local name for UCS-2LE is UCS-2LE
iconv.c:187:local name for UCS-2BE is UCS-2BE
iconv.c:349:setting up conversions for client charset "UTF-8"
iconv.c:351:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion
iconv.c:391:preparing iconv for "ISO-8859-1" <-> "ISO-8859-1" conversion
iconv.c:394:tds_iconv_open: done
net.c:205:Connecting to x.x.x.x port 1433 (TDS version 4.2)

(btw: Notice the TDS version used: 4.2 while we defined 7.0)

Does anyone know how to solve this issue?

BR Jos

Rabobank disclaimer: http://www.rabobank.nl/disclaimer

More information about the FreeTDS mailing list