[kaffe] ByteToCharIconv/CharToByteIconv

Ito Kazumitsu ito.kazumitsu at hitachi-cable.co.jp
Thu Dec 11 17:11:02 PST 2003


Hi,

In message "[kaffe] ByteToCharIconv/CharToByteIconv"
    on 03/12/11, Atsushi Nemoto <anemo at mba.ocn.ne.jp> writes:

> Does ByteToCharIconv/CharToByteIconv work on little endian system?

Yes.

I can use SHIFT_JIS with the original ByteToCharIconv/CharToByteIconv.
My environment is Linux 2.4.18-3 on i686.  And config/config.h says:

/* Define to 1 if your processor stores words with the most significant byte
   first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */

> On my little endian system, iconv with "UCS-2" acts as "UCS-2LE", so
> additional swab in those classes is not needed.

Some version of iconv may treat UCS-2 as machine-dependent.
But libiconv-1.9.1 definitely treats UCS-2 as big-endian
although the behaviour of ucs2_mbtowc may be changed by
FFFE/FEFF marks as endianness indicators.

> Here is a patch.  Without this patch, I could not use SHIFT_JIS
> encoding.

Your patch makes ByteToCharIconv/CharToByteIconv much simpler,
but I don't know whether using UCS-2BE or UCS-2LE is a good
thing.




More information about the kaffe mailing list