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: "ZIGLIO Frediano" <Frediano.Ziglio AT vodafoneomnitel.it>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] detecting iconv names
  • Date: Fri, 2 May 2003 16:59:49 +0200

>
> > From: ZIGLIO Frediano [mailto:Frediano.Ziglio AT vodafoneomnitel.it]
> > Sent: May 2, 2003 9:04 AM
> >
> > > I'm doing some tests to test iconv.
>
> We're thinking along the same lines. :-)
>
> > > My intention is to convert some code and see results. Problem
> > > is portability
> ...
> > > Now, problem is perl. Does all system support perl?
>
> We can't depend on Perl. I like Perl very much, but we
> shouldn't make Perl
> a requirement, even for testing FreeTDS.
>
> > Is cksum portable ?
>
> Pretty much:
>
> The cksum utility is expected to conform to IEEE Std 1003.2-1992
> ("POSIX.2").
>

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

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page