Skip to Content.
Sympa Menu

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

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] hex(92), freeTDS and MS SQL
  • Date: Tue, 19 Dec 2006 08:54:26 +0100

>
> 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 ^_^
>

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 !!!
Are you sure you are using correct protocol version? libTDS should
detect correctly that your db encode data as cp1252 and use correct
translation (if you have setup correctly your db, sql server support
only an encoding while sql2k support different encoding for every
column). 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). You are using PHP so probably you have to set html
page output to cp1252 too. I don't see utf-8 at all...

freddy77





Archive powered by MHonArc 2.6.24.

Top of Page