Skip to Content.
Sympa Menu

freetds - RE: [freetds] Charset conversion Polish

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "FlavianoMa" <FlavianoMa.software AT teseo.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Charset conversion Polish
  • Date: Thu, 5 May 2005 19:31:13 +0200

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.
----------------------------------------------------------------------------------------------







Archive powered by MHonArc 2.6.24.

Top of Page