[freetds] charset, mssql

Frediano Ziglio freddyz77 at tin.it
Tue Apr 29 14:36:55 EDT 2003


Current CVS do not work with TDS8 (mssql2k protocol).
If you want to try FreeTDS snapshot use TDS7 even for mssql2k.
Problem is due to conversion stuff. During login TDS8 server send
default collation for database using env type 7. This collation is
readed and used to setup iconv according (using collation charset)
however all next conversation use still ucs2...
TDS7 do not have this problem cause return collation information in a
different way (not still supported by FreeTDS, env types 5 and 6).
TDS7 and TDS8 handle collation in slightly different ways:

TDS7
- every database have it's collation
- columns inherit collation from database
- system informations (query, column names and so on) are passed in ucs2
format (always!)
- single-byte columns data use default collation of current database

TDS8
- every database have it's DEFAULT collation
- every columns have it's collation
- system informations (query, column names and so on) are passed in ucs2
format (like TDS7)
- single-byte columns data use collation specified (we can use different
collation for every column)

How to handle different behavior??
I think we should have some fixed iconv structures (like database one
and ucs2) and cache others conversions.
Also tds_get_string is not sufficient (perhaps tds_get_string(...,
conversion_info) )

bye
  freddy77




More information about the FreeTDS mailing list