[freetds] hex(92), freeTDS and MS SQL

Lapo Luchini lapo at lapo.it
Tue Dec 19 16:47:03 EST 2006


ZIGLIO, Frediano, VF-IT <Frediano.Ziglio <at> vodafone.com> writes:

> I didn't use sql server 7 since some years but if you use protocol
> version 7.0 you shouldn't have a iso_1 !!!

I am using 7.0, but:

22:03:26.150333 Starting log file for FreeTDS 0.63
        on 2006-12-19 22:03:26 with debug level 99.
22:03:26.150435 names for ISO-8859-1: ISO-8859-1
22:03:26.150451 names for UTF-8: UTF-8
22:03:26.150464 names for UCS-2LE: UCS-2LE
22:03:26.150477 names for UCS-2BE: UCS-2BE
22:03:26.150489 iconv to convert client-side data to the "UTF-8" character set
22:03:26.150514 tds_iconv_info_init: converting "UTF-8"->"UCS-2LE"
22:03:26.150533 tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
22:03:26.150558 Connecting to A.B.C.D port 1433, TDS 7.0.
[...]
22:03:26.172954 processing TDS7 result. set current_results to tds->res_info
22:03:26.172972 tds_get_string: reading 2 from wire to give 1 to client.
22:03:26.172989 tds7_get_data_info:1558: 
        colname = i (1 bytes)
        type = 56 (int)
        server's type = 56 (int)
        column_varint_size = 0
        column_size = 4 (4 on server)
22:03:26.173008 adjust_character_column_size:
        Server charset: ISO-8859-1
        Server column_size: 50
        Client charset: UTF-8
        Client column_size: 200

> With your patch you are just trying to set client charset to
> cp1252. This can be done configuring correctly your freetds connection
> (using freetds.conf).

Nope, I changed the source encoding (the 1-byte on-the-wire format), not the
destinatio (the client's), or at least... that's what I have meant to do (it was
my first peek at FreeTDS source, so I may well be wrong).

> You are using PHP so probably you have to set html
> page output to cp1252 too. I don't see utf-8 at all...

I used this .conf entry:

        host = A.B.C.D
        port = 1433
        tds version = 7.0
        client charset = UTF-8

and the PHP subsystem is properly setup to use UTF-8 and output (even if this
database is CP-silly-1252, I still have Unicode data floating around those pages
and prefer to use for everything UTF-8 anyway).

BTW, to everybody: thanks for the kind help, it's not so commonly found.
Not at all =)



More information about the FreeTDS mailing list