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

Sebastien FLAESCH sf at 4js.com
Mon Sep 8 11:35:19 EDT 2008


Frediano,

Sorry my YES was too fast: I should have checked with a simple ODBC program.

Even inserting does not fully work for now:

When binding with a small ColumnSize (like 2), I get invalid data in the
SQL Server Profiler trace (only pieces of the value).

Looks like the conversion from UTF-8 to UCS-2 relies on the ColumnSize
and does not work properly when that size is small...
(Maybe the conversion buffer used is allocated according to ColumnSize,
as a number of bytes?)

See attached example: Using ColumnSize=2, it does not insert all data,
but when using ColumnSize>=6 it works...

Binding first value (4 bytes) with ColumnSize=4, it works, and second
value (6 bytes) it works with ColumnSize=6...

Since ColumnSize defines a number of CHARACTERS, something is wrong here.

Seb

ZIGLIO, Frediano, VF-IT wrote:
>> Frediano,
>>
>> I have just tested latest sources with SQLBindParameter using:
>>
>>   ParameterType  = SQL_WVARCHAR
>>   ColumnSize     = 2
>>
>> It works now but I just wanted to confirm something with you:
>>
>> When binding with SQL_VARCHAR (no W) with ColumnSize=20, SQL Server
>> Profile trace shows the parameter for sp_prepare is defined as:
>>
>>     @P1 VARCHAR(20)
>>
>> When binding with SQL_WVARCHAR, I see following type:
>>
>>     @P1 NVARCHAR(40)
>>                  ^^----!!!
>>
>> Even if ColumnSize=20 ...
>>
>> Why 40 and not 20? Is this expected?
>>
> 
> Try this patch
> 
> freddy77
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: odbctest113.c
Url: http://lists.ibiblio.org/pipermail/freetds/attachments/20080908/14411dd0/attachment.c 


More information about the FreeTDS mailing list