This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: java/2313: Java SimpleDateFormat crash with non US locales (french...)
- To: diam at ensta dot fr
- Subject: Re: java/2313: Java SimpleDateFormat crash with non US locales (french...)
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Mon, 19 Mar 2001 10:30:41 +1200
- CC: gcc-gnats at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- References: <20010318101850.31088.qmail@sourceware.cygnus.com>
diam@ensta.fr wrote:
> >Fix:
> Thanks to Bryce McKinlay, I added the 2 following files
> LocaleData_fr.java and LocaleData_fr_FR.java near
> the existing files LocaleData_en.java and LocaleData_en_US.java
> and added these two file in:
> src/cvs/gcc/libjava/Makefile.am
> src/cvs/gcc/libjava/Makefile.in
Cool, thanks. I'll look at checking those in shortly.
> But these LocaleData_fr.java files doen't accept french
> accents (this is another problem, gcc should ignore accents
> in source file)
This seems to be a side-effect of compiling libjava with "--encoding=UTF-8". This simple example:
public class Hello
{
public static void main ( String []arguments)
{
System.out.println ("Liberté, égalité, fraternité !");
}
}
works fine in the default mode, but with "--encoding=UTF-8" it produces incorrect output.
$ gcj Hello.java --main=Hello
$ ./a.out
Liberté, égalité, fraternité !
$ gcj --encoding=UTF-8 Hello.java --main=Hello
$ ./a.out
Libert lit fraternit
Unfortunately, I know very little about character encoding. Maybe Tom can suggest a fix or workaround. Perhaps its possible to do something to convert the file to a UTF-8 encoding before trying to compile it?
regards
[ bryce ]