This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SHIFT_JIS encoding option problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]