SHIFT_JIS encoding option problem

Tom Tromey tromey@redhat.com
Fri Feb 14 22:17:00 GMT 2003


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


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /