[freetds] detecting iconv names

ZIGLIO Frediano Frediano.Ziglio at vodafoneomnitel.it
Fri May 2 10:59:49 EDT 2003


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



More information about the FreeTDS mailing list