[freetds] are varchar and nvarchar actually the same? [Was: hex(92), freeTDS and MS SQL]

Lapo Luchini lapo at lapo.it
Mon Jan 29 04:37:53 EST 2007


ZIGLIO, Frediano, VF-IT wrote:
>> Server: SQL server 7
>> Using FreeTDS 0.63 with official patch to use CP1252 on server "iso1"
>> Client encoding: UTF-8
> Well... there's no official 0.63 patch. 0.64 and HEAD are updated, there is a post 0.64 patch.

Yesss, what I meant was actually something more like "with the relevant
part of the official post-0.64-patch applied over 0.63", but I was a
tiny bit too terse, as usual. ;-)

>> Is SQLServer7 purposefully converting what it is received in 
>> CP1252 only
>> to be converted back to UCS2 thereafter???
> I think so. 
> The reason it's not so easy. You should solve with
> mssql_query("UPDATE P SET c = '$var', n = N'$var' WHERE i = 1");

Oookay. A bit of ignorance on my side here, but I prefer it this way:
this way the problem is easily solved, eheh.

I just tried, I can confirm it is working using the N'':
W: c3 a0 e2 80 98 e2 80 99 e2 80 9c e2 80 9d c3 85 c5 ae e7 a7 81
C: c3 a0 e2 80 98 e2 80 99 e2 80 9c e2 80 9d c3 85 55 3f
N: c3 a0 e2 80 98 e2 80 99 e2 80 9c e2 80 9d c3 85 c5 ae e7 a7 81

    Lapo




More information about the FreeTDS mailing list