[freetds] Charset conversion Polish

FlavianoMa FlavianoMa.software at teseo.com
Thu May 5 13:31:13 EDT 2005


In my system is not available the iconv library, so I modified the
built-in iconv substitute in FreeTDS to accept different charset (
CP1250, CP1254, CP1256, CP1251 ).
Now when I read data from the SQL Server I receive data correctly.
When I write on the server, I write the correct Unicode buffer ( I
checked on freetds.log), but the server convert my character before save
on DB, so after if I'll read the same buffer it will be different (
checked on freetds.log).

So if I write a polish char to SQL Server installed in US WinXp it
doesn't work.
If I write a polish char to SQL Server installed in Polish WinXp it
works.

It seems like if I need to specify to the Server the charset that I
using on client.

Why?

Thanks
Flaviano

-----Original Message-----
From: freetds-bounces at lists.ibiblio.org
[mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Frediano Ziglio
Sent: Saturday, April 16, 2005 5:22 PM
To: FreeTDS Development Group
Subject: Re: [freetds] Charset conversion Polish

Il giorno sab, 16-04-2005 alle 10:45 +0200, FlavianoMa ha scritto:
> I have my SQL Server installed on Windows Xp in Polish.
> When I connect from TDS I can't read correctly the Polish chars.
> If I set client charset as ISO-8859-1 I received an error and the 
> Polish chars are translated in ?.
> If I set client charset as UTF-8 I received the Polish chars as 2 byte

> in my string.
> If I set client charset as UCS-2LE or UCS-2BE I can't connect.
> I use FreeTDS 0.62.4 and below the FreeTDS.LOG: the 1st is when I 
> connected with ISO-8859-1, the 2nd is when I connected with UTF-8
> 
> The correctly conversion for T_PATTNAME should be:
> 0x4F 0x42 0xA3 0x2E 0x20 0x50 0x52 0x5A 0x59 0x8C 0x52 0x2E 0x20 0x50
> 0x52 0x5A 0x45 0x44 0x4E 0x49 0x41 0x00
> 

You can read polish character correctly only if conversion charset
support your charset and you select the right charset. iso-8859-1 cannot
support polish so it replace with ?, utf-8 correctly return 2 byte for
polish, ucs2 still not supported (and will never be using dblib...). Use
correct iconv library and charset. So, don't use --disable-libiconv and
set correct charset.


Flaviano Maricotti
Software Department

---------------------------------------------------------------------------------------------- 
TESEO spa  via Agnelli 49  63023 FERMO (AP) ITALY   Tel. +39 0734 628818  Fax. +39 0734 628816

software at teseo.com      FlavianoMa.software at teseo.com


DISCLAIMER. This electronic mail transmission may contain legally priviledge and/or confidential information. Do not read this if you are not the person(s) named.  Any use, distribution, copying or disclosure by any other person is stricly prohibited. If you received this trasmission in error destroy the original transmission and its attachments without reading or saving in any manner.
----------------------------------------------------------------------------------------------
 





More information about the FreeTDS mailing list