gcj/33
Stephane Bortzmeyer
bortzmeyer@pasteur.fr
Fri Sep 3 01:00:00 GMT 1999
The following reply was made to PR gcj/33; it has been noted by GNATS.
From: Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
To: tromey@cygnus.com
Cc: Java Gnats Server <java-gnats@sourceware.cygnus.com>,
bortzmeyer@pasteur.fr, 42895@bugs.debian.org
Subject: Re: gcj/33
Date: Fri, 03 Sep 1999 09:58:37 +0200
On Thursday 2 September 1999, at 20 h 54, the keyboard of Tom Tromey
<tromey@cygnus.com> wrote:
> I looked at this problem.
[BTW, where can I read the PR on gcj? I find nothing on
http://sourceware.cygnus.com .]
> gcj assumes that the input file is itself Utf-8 encoded. Is this the
> case in your example?
No, they were in ISO-8859-1 (Latin 1).
> My guess is that the other compilers assume
> that the input file is encoded according to your locale's charset, and
Hmmm, this is certainly specified in the Java Language Definition, no ? If so,
this is just a matter of finding who is right.
> As a workaround you can convert your program to Utf-8 using GNU recode
The workaround works:
ishtar:~/tmp/Java> recode Latin1..UTF-8 Hello.java
ishtar:~/tmp/Java> more Hello.java
public class Hello {
public static void main ( String []arguments)
{
System.out.println ("LibertÃÂé, ÃÂégalitÃÂé, fraternitÃÂé !");
}
}
ishtar:~/tmp/Java> gcj -C Hello.java
ishtar:~/tmp/Java> kaffe Hello
Liberté, égalité, fraternité !
> In the long term I agree that gcj should read the file using the
> locale (possibly augmented with a new flag to indicate the encoding).
Well, the most important for me is that all Java compilers do the same and follow the Java Language Definition.
Apart from that, practically speaking, I would say that noone can type UTF-8 on her keyboard, while many people can enter Latin-*.
More information about the Java-prs
mailing list