This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: SHIFT_JIS encoding option problem
- From: Tom Tromey <tromey at redhat dot com>
- To: <Katsuaki dot Sugiyama at jp dot yokogawa dot com>
- Cc: <java at gcc dot gnu dot org>
- Date: 14 Feb 2003 15:07:47 -0700
- Subject: Re: SHIFT_JIS encoding option problem
- References: <3D97FB62F535A442A548DD5239B841C5D0ABBC@EXCHANGE04.jp.ykgw.net>
- Reply-to: tromey at redhat dot com
>>>>> ">" == <Katsuaki.Sugiyama@jp.yokogawa.com> writes:
>> class A {
>> public static void main(String[] a){
>> System.out.println("\"hello\"");
>> }
>> }
You didn't say what system you are using. The --encoding option is
very sensitive to the system, since not all iconv implementations are
equal. I'll assume you're using Linux.
I tried compiling this with `--encoding=SJIS'. Sure enough, I saw an
error.
I'm not convinced this is a gcj bug, however.
Try this:
iconv --from-code=SJIS --to-code=UTF-8 A.java
When I do this I see that the `\' has been transformed into a yen
symbol.
Either the bytes in this file don't mean what you think (i.e., that
`\' is really a yen symbol in SJIS, and you need to have different
bits for gcj to see it as a backslash), or there is a bug in the glibc
iconv. I suspect the former; ISTR hearing about the backslash-vs-yen
symbol problem elsewhere.
In either case I don't see what we could do about it in gcj. We're at
the mercy of the system iconv here.
Tom