Skip to Content.
Sympa Menu

freetds - RE: [freetds] detecting iconv names

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] detecting iconv names
  • Date: Fri, 2 May 2003 14:19:39 -0400

> From: ZIGLIO Frediano [mailto:Frediano.Ziglio AT vodafoneomnitel.it]
> Sent: May 2, 2003 11:00 AM
>
> So, a script like
> OUT=`echo foo | iconv -f iso88591 -t ucs2 | cksum | cut -d ' ' -f 1`
> is portable !!!
> I must check results cause some iconv put bytes in front of
> ucs2 if no endian specified...
>
> Whatching configure this code should also be portable
>
> tds_iconvtest='echo $TDSSTR | iconv -f $TDSFROM -t $TDSTO |
> cksum | cut -d " " -f 1'
> TDSSTR=foo
> TDSFROM=iso88591
> TDSTO=ucs2
> if test "`eval $tds_iconvtest`" = "3637111430"; then
> echo Successfully converted !
> fi

Yes, except "iso88591" isn't portable, of course, unless you run it though
tds_canonical_charset_name(), subject to its limitations.

I really think tds_canonical_charset_name() is the key, btw. It must work,
for us to convert server charset names to iconv names i.e., return a name
that the linked-in iconv will honor. Making it for "any" iconv is no simple
thing, of course, but that doesn't make it any less necessary. To the
extent that we care about non-GNU iconv, that is.

Noodle: it might be nice to have a little utility, src/apps/charsetname,
that prints the canonical name (and iconv vendor) for any input. Would help
your scripts and be a simple diagnostic. Could be a feature of tsql
instead, like my "version" command and -C switch, but then tsql would need
an offline mode.

--jkl


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.





Archive powered by MHonArc 2.6.24.

Top of Page