[freetds] select bug...

Lowden, James K LowdenJK at bernstein.com
Tue May 13 12:59:12 EDT 2003

> > Starting log file for FreeTDS 0.62.dev.20030513
> >         on 2003-05-13 11:02:26 with debug level 99.
> > iconv to convert client-side data to the "ISO-8859-7" character set
> > 11:02:26.244776 tds_iconv_info_init: client charset name 
> > "ISO-8859-7" unrecognized
> > 11:02:26.244806 Connecting to port 1433, TDS 7.0.
> > 11:02:26.245102 tds_put_string converting 19 bytes of
> > "atlas.ace-hellas.gr"
> > 11:02:26.245121 tds_put_string converting 19 bytes of
> > "atlas.ace-hellas.gr"
> I fixed problem in CVS. ISO-8859-7 wasn't in our tables...

But they were!  

$ grep -n 8859-7  alternative_character_sets.h
168:    , {         "ECMA-118", "ISO-8859-7"             }
170:    , {         "ECMA-118", "ISO_8859-7"             }
171:    , {         "ECMA-118", "ISO_8859-7:1987"        }
179:    , {       "ISO-8859-7", "ISO-8859-7"             }  // your addition

Argh!!  If Spyros had used the (badly chosen) canonical name -- ECMA-118 --
it would have Just Worked.  The boneheaded mistake is that
tds_iconv_info_init() doesn't call tds_canonical_charset_name() before
attempting to look up the character width.  Sorry to have misled you,

s/does/did/g.  I just committed a fix, and rolled back your .h updates.  No
offense, I hope!  

A word on how the "canonical" name was chosen: it wasn't, particularly.  I
took the list produced by (GNU) "iconv -l".  Synonyms are listed on one
line.  I chose the first name on the line.  I see now that that wasn't
particularly intuitive, because the names are ordered alphabetically, and
the first one is by no means the most commonly used.  

I don't consider this to be a giant problem, because the point is simply to
get *some* fixed name, and use it to look up the characteristics of the
charset.  In fact, we might be better off if the canonical "name" were a
number; it would make comparisons cheaper and simpler.  The only other real
downside is that the log will reflect the canonical name, not its more
familiar variant.  For charset names we encounter often, it might be well to
switch to something easier to say and type. 

The good new is, Spyros helped us flush out this bug, and it's gone.  From
now on, the log will be very clear about any charset lookup failures, and
any form of any charset name will be valid in freetds.conf.  The even better
news is, it seems we can pass Greek text between PHP and Microsoft servers.
I know it's been tried before, but I don't remember it ever succeeding.  

Hmm.  FreeTDS is confirmed to speak Italian and Greek.  Classically trained,


The information contained in this transmission may contain privileged and confidential information and is intended only for the use of the person(s) named above. If you are not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender immediately by reply e-mail and destroy all copies of the original message. Please note that we do not accept account orders and/or instructions by e-mail, and therefore will not be responsible for carrying out such orders and/or instructions.

More information about the FreeTDS mailing list