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

Sebastien FLAESCH sf at 4js.com
Tue Aug 12 11:03:30 EDT 2008


Sorry I mean SQL_WVARCHAR, not SQL_NVARCHAR...

I made a little UTF-8 test (see attachment *warning*: UTF-8 file!).

Simple SQL statements without SQL parameters seem to work... (CREATE TABLE, INSERT).
But some characters are not converted properly (iconv issue?):
The 'abcéáô' and 'abcéîô' strings become 'abceao' and 'abceio' in the database...

Further, I can't execute an INSERT with SQLBindParameter():

When using SQL_WVARCHAR, I get an error but diagnostic info shows unreadable strings:

Error -1 at: SQLExecute StmtH
Diagnostic info:
   SQL State: \uffff\uffffu
   SQL code : 0
   Message  :

With SQL_VARCHAR, I get this:

Error -1 at: SQLExecute StmtH
Diagnostic info:
   SQL State: 42000
   SQL code : 4002
   Message  : [FreeTDS][SQL Server]The incoming tabular data stream (TDS) protocol stream is incorrect. The stream ended unexpectedly.


Seb

Sebastien FLAESCH wrote:
> Hi all,
> 
> I would like to start some tests using ODBC in a UTF-8 environment.
> 
> What is the current status of this project?
> 
> I found this in the TODO file:
> 
> . conversion from ucs2 to utf8, provide for 2+ bytes/character
> 
> I have set ClientCharset = UTF8 in the odbc.ini file...
> 
> What SQL_* types should I use to bind buffers with SQLBindParameter
> or SQLBindCol, when using UTF8 charset?
> 
> For example, would this be ok?
> 
>      char v_char[41];   /* Can hold up to 10 UTF-8 characters */
> 
>      SQLBindParameter(m_hstmt1, 2, SQL_PARAM_INPUT,
>                       SQL_C_CHAR,
>                       SQL_NVARCHAR, 10, 0, v_char, 0,
>                       &v_ind_char);
> 
> Assuming that I use a NVARCHAR(10) in the db?
> 
> Thanks!
> Seb
> _______________________________________________
> 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: odbctest11.c
Url: http://lists.ibiblio.org/pipermail/freetds/attachments/20080812/131ad706/attachment.c 


More information about the FreeTDS mailing list