freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Frediano Ziglio <freddyz77 AT tin.it>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] Charset conversion Polish
- Date: Sat, 16 Apr 2005 17:21:35 +0200
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.
> Thanks
>
> ***////////////////////////////////////////////////////ISO-8859-1///////
> ///////////////////////////////////////////////////////////****
> Starting log file for FreeTDS 0.62
> on 2005-04-16 08:05:08 with debug level 99.
> Using trivial iconv from
> iconv2.c
^^^^ trivial iconv support only iso-8859-1, utf8 and ucs2...
> names for ISO-8859-1: ISO-8859-1
> names for UTF-8: UTF-8
> names for UCS-2LE: UCS-2LE
> names for UCS-2BE: (null)
> iconv to convert client-side data to the "ISO-8859-1" character set
> 08:05:08 tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
> 08:05:08 tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
> 08:05:08 Connecting to 172.27.0.113 port 1433, TDS 8.0.
> 08:05:08 tds_put_string converting 12 bytes of "xxx.xx.x.xxx"
> 08:05:08 tds_put_string wrote 24 bytes
> 08:05:08 tds_put_string converting 3 bytes of "xxx"
> 08:05:08 tds_put_string wrote 6 bytes
> 08:05:08 tds_put_string converting 13 bytes of "xxxxxxxxxxxxx"
> 08:05:08 tds_put_string wrote 26 bytes
> 08:05:08 tds_put_string converting 12 bytes of "xxx.xx.x.xxx"
> 08:05:08 tds_put_string wrote 24 bytes
> 08:05:08 tds_put_string converting 10 bytes of "DB-Library"
> 08:05:08 tds_put_string wrote 20 bytes
> 08:05:08 tds_put_string converting 10 bytes of "us_english"
> 08:05:08 tds_put_string wrote 20 bytes
> 08:05:08 tds_put_string wrote 0 bytes
> 08:05:08 tds_process_login_tokens()
> Received header @ 08:05:09
> 0000 04 01 01 95 00 35 01 00- |.....5..|
>
>
> Received packet @ 08:05:09
> 0000 e3 1b 00 01 06 6d 00 61-00 73 00 74 00 65 00 72 |.....m.a .s.t.e.r|
> 0010 00 06 6d 00 61 00 73 00-74 00 65 00 72 00 ab 74 |..m.a.s. t.e.r..t|
> 0020 00 45 16 00 00 02 00 25-00 43 00 68 00 61 00 6e |.E.....% .C.h.a.n|
> 0030 00 67 00 65 00 64 00 20-00 64 00 61 00 74 00 61 |.g.e.d. .d.a.t.a|
> 0040 00 62 00 61 00 73 00 65-00 20 00 63 00 6f 00 6e |.b.a.s.e . .c.o.n|
> 0050 00 74 00 65 00 78 00 74-00 20 00 74 00 6f 00 20 |.t.e.x.t . .t.o. |
> 0060 00 27 00 6d 00 61 00 73-00 74 00 65 00 72 00 27 |.'.m.a.s .t.e.r.'|
> 0070 00 2e 00 0f 43 00 45 00-4c 00 53 00 49 00 55 00 |....C.E. L.S.I.U.|
> 0080 53 00 5f 00 58 00 50 00-50 00 5f 00 50 00 4f 00 |S._.X.P. P._.P.O.|
> 0090 4c 00 00 00 00 e3 08 00-07 05 15 04 d0 00 00 00 |L....... ........|
> 00a0 e3 17 00 02 0a 75 00 73-00 5f 00 65 00 6e 00 67 |.....u.s ._.e.n.g|
> 00b0 00 6c 00 69 00 73 00 68-00 00 ab 78 00 47 16 00 |.l.i.s.h ...x.G..|
> 00c0 00 01 00 27 00 43 00 68-00 61 00 6e 00 67 00 65 |...'.C.h .a.n.g.e|
> 00d0 00 64 00 20 00 6c 00 61-00 6e 00 67 00 75 00 61 |.d. .l.a .n.g.u.a|
> 00e0 00 67 00 65 00 20 00 73-00 65 00 74 00 74 00 69 |.g.e. .s .e.t.t.i|
> 00f0 00 6e 00 67 00 20 00 74-00 6f 00 20 00 75 00 73 |.n.g. .t .o. .u.s|
> 0100 00 5f 00 65 00 6e 00 67-00 6c 00 69 00 73 00 68 |._.e.n.g .l.i.s.h|
> 0110 00 2e 00 0f 43 00 45 00-4c 00 53 00 49 00 55 00 |....C.E. L.S.I.U.|
> 0120 53 00 5f 00 58 00 50 00-50 00 5f 00 50 00 4f 00 |S._.X.P. P._.P.O.|
> 0130 4c 00 00 00 00 ad 36 00-01 71 00 00 01 16 4d 00 |L.....6. .q....M.|
> 0140 69 00 63 00 72 00 6f 00-73 00 6f 00 66 00 74 00 |i.c.r.o. s.o.f.t.|
> 0150 20 00 53 00 51 00 4c 00-20 00 53 00 65 00 72 00 | .S.Q.L. .S.e.r.|
> 0160 76 00 65 00 72 00 00 00-00 00 08 00 02 f8 e3 13 |v.e.r... ........|
> 0170 00 04 04 34 00 30 00 39-00 36 00 04 34 00 30 00 |...4.0.9 .6..4.0.|
> 0180 39 00 36 00 fd 00 00 00-00 00 00 00 00 |9.6..... .....|
>
>
> 08:05:09 looking for login token, got e3(ENVCHANGE)
> 08:05:09 tds_process_default_tokens() marker is e3(ENVCHANGE)
> tds_get_string: reading 12 from wire to give 6 to client.
> tds_get_string: reading 12 from wire to give 6 to client.
> 08:05:09 looking for login token, got ab(INFO)
> 08:05:09 tds_process_default_tokens() marker is ab(INFO)
> tds_get_string: reading 74 from wire to give 37 to client.
> tds_get_string: reading 30 from wire to give 15 to client.
> 08:05:09 looking for login token, got e3(ENVCHANGE)
> 08:05:09 tds_process_default_tokens() marker is e3(ENVCHANGE)
> 08:05:09 tds_iconv_info_init: use memcpy to convert
> "ISO-8859-1"->"CP1250"
^^^^ the "use memcpy" means that FreeTDS is not converting correctly
charsets...
ciao
freddy77
-
[freetds] Charset conversion Polish,
FlavianoMa, 04/16/2005
- Re: [freetds] Charset conversion Polish, Frediano Ziglio, 04/16/2005
Archive powered by MHonArc 2.6.24.