[freetds] Status of UTF-8 support in 0.83 dev

Sebastien FLAESCH sf at 4js.com
Thu Aug 14 10:02:04 EDT 2008


When I print the client and the server charset in tds_convert_string()
called from tds_put_data(), I see:

   char_conv->client_charset.name = "UTF-8"
   char_conv->server_charset.name = "CP1252"

I expected UCS-2 for the server charset...????

Hence it's normal that the conversion of non-CP1252 compatible chars
like 鴻 result in error...

I appears that curcol->char_conv points to the client2server_chardata
TDSICONV structure, because in tds_set_param_type(), the data type is
not identified as a UNICODE type...

So when binding the buffers with sqltype SQL_[VAR]CHAR, it appears that
the Sybase type used is not "UNICODE"...

Should I then bind with SQL_WCHAR / SQL_WVARCHAR?

I made a little test (attached, with log)... still failing.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: odbctest111.c
Url: http://lists.ibiblio.org/pipermail/freetds/attachments/20080814/99df1a6b/attachment.c 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tds.log
Type: text/x-log
Size: 15073 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20080814/99df1a6b/attachment.bin 

More information about the FreeTDS mailing list