This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Solaris -vs- iconv
>>>>> "Bryce" == Bryce McKinlay <bryce@albatross.co.nz> writes:
>> A bare "gcj" invocation fails on Solaris, which isn't very useful.
Bryce> I agree. I've always thought it to be quite nasty that we have
Bryce> to pass an explicit "--encoding" flag in the build to get it to
Bryce> work on all platforms. We really need to default to whatever
Bryce> javac defaults to for encodings, and reserve the "--encoding"
Bryce> flag for people who know that they really need it.
Unfortunately javac has it easier than us: javac is written in Java
and can simply use the Java encoder, which, unlike the Solaris
iconv(), is sane.
The individual decisions we've made are all reasonable (IMHO) but add
up to an unreasonable whole :-(
* We want to use the user's locale by default.
This is what javac claims to do, so following it is almost a
requirement.
* We want to use the system iconv if it is available
One reason for this is simply that we don't already have an iconv()
replacement in the tree, and we've already made the gcc tree much
larger with our required libraries. Adding an iconv replacement
(and there is at least one good free one) on top of this seems like
a pain. We could check for and use it if it is available, but this
won't help typical Solaris users.
* We want to use UCS-2 in the lexer.
Well, ok, we probably don't really *need* to. We currently do
because I didn't feel like rewriting the whole lexer. However using
UCS-2 here is reasonable since it makes parts of the code cleaner.
Using something like UTF-8 would mean returning strings and such.
We could disable iconv() support on Solaris. That would "work".
Tom