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

Lapo Luchini lapo at lapo.it
Tue Dec 19 02:25:16 EST 2006


James K. Lowden <jklowden <at> freetds.org> writes:

> Moral: don't let the client put windows-1252 data in a column encoded as
> ISO 8859-1.  Don't declare to the server that your windows-1252 data are
> ISO 8859-1.  Be honest!  Say what you've got, and maybe use a unicode
> datatype e.g. NVARCHAR to store it.  Then things will go much easier.  

Of course using NVARCHAR is the *correct* solution, but if you happen to have to
wokrk with an existing and huge SqlServer 7 database "that displays the accents
right with EVERY OTHER application", your new little PHP app *have* to work as
well with (existing) Windows-1252 data.

AFAIK SQLServer7 doesn't know anything about the ISO-1-ness of the fields: they
just "are".
And, in fact, they "are" Windows-1252, whatever he states in the wire-protocol:
all its tool show them as CP1252. There is probably some heavy confusion in some
Microsoft folk, that tought that since the two formats are 90% equal, they are
perfectly equal...

If I can "tell" SQLServer7 to just say "1252" instead of "iso_1"... just thell
me how, because I don't know it, and it would of course be a better solution
that using an ugly patch ^_^



More information about the FreeTDS mailing list