[freetds] CTLib patch

Frediano Ziglio freddy77 at gmail.com
Fri Jun 19 05:01:07 EDT 2009


2009/6/17 Andrew Victor <avictor.za at gmail.com>
>
> hi Frediano,
>
> > ... it seems that client datatype does not support
> > wide characters, isn't it? So you are correctly trying to bind client
> > utf-8 (multi-byte) to server wide characters (nvarchar in mssql),
> > isn't it?
>
> There must be some data-type mapping to NVARCHAR?  I assumed it was
> CS_UNICHAR_TYPE.
>
>
> > Do you have an example so I can write a small unittests??
>
> I have extended the FreeTDS ctlib unit-test "rpc_ct_param.c", which is attached.
> Just ensure you have "client charset = UTF-8" in you freetds.conf
>
> Without the patch the unit-test gives:
>
> Open Client Message:
> Message number: LAYER = (0) ORIGIN = (0) SEVERITY = (9) NUMBER = (98)
> Message String: Error converting characters into server's character
> set. Some character(s) could not be converted
>
> Server message:
> Message number: 8016, Severity 16, State 26, Line 1
> Server 'xxxx'
> Message String: The incoming tabular data stream (TDS) remote
> procedure call (RPC) protocol stream is incorrect. Parameter 2
> ("@nvparam"): Data type 0xA7 has an invalid data length or metadata
> length.

Attached my patch which merge your test (currently not working)

freddy77
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ctlib_unichar.diff
Type: application/octet-stream
Size: 5708 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20090619/4be81847/attachment.obj 


More information about the FreeTDS mailing list