This is the mail archive of the
mailing list for the Java project.
Solaris -vs- iconv
- To: java at gcc dot gnu dot org
- Subject: Solaris -vs- iconv
- From: Jeff Sturm <jsturm at one-point dot com>
- Date: Mon, 26 Mar 2001 16:49:55 -0500 (EST)
Now that I am trying to "make check" on Solaris, I went back and reread
the iconv threads.
A bare "gcj" invocation fails on Solaris, which isn't very useful.
Passing --encoding=UTF-8 works, as does LANG=en_US.UTF-8 in my
environment. But dejagnu needs some help, because it doesn't have the
--encoding hack and libtool supresses my LANG setting (why?).
It seems that Solaris iconv understands all of ISO8859-1, UTF-8,
UCS-2/UTF-16 and plain ASCII just fine. The problem is that it cannot
translate between arbitrary combinations of those :(
So how do I proceed?
1) Hack libjava.exp for --encoding.
I've done this, but it's a little ugly... I had to get all the cases for
source/bytecode compiling, plus jv-scan. But maybe I was doing something
Also, this is no help to the Solaris user who actually needs to use "gcj
2) Hack lex.c to do a 2-step character translation.
The native Solaris iconv will translate anything to UTF-8, and there is a
builtin UTF-8 -> UCS-2 translator. These could be chained to do want we
But since this isn't needed for glibc, I wonder if Solaris is really the
special case? Does anybody use iconv on any other platforms?
3) Forget about UCS-2 in lex.c.
I suppose there is a good reason for it, but I haven't stared at lex.c
long enough to figure out what. Strings are converted back to UTF-8
before they are written anyhow.