java/2313: Java SimpleDateFormat crash with non US locales (french...)

Bryce McKinlay bryce@albatross.co.nz
Sun Mar 18 14:26:00 GMT 2001


The following reply was made to PR java/2313; it has been noted by GNATS.

From: Bryce McKinlay <bryce@albatross.co.nz>
To: diam@ensta.fr
Cc: gcc-gnats@gcc.gnu.org, java-patches@gcc.gnu.org
Subject: Re: java/2313: Java SimpleDateFormat crash with non US locales 
 (french...)
Date: Mon, 19 Mar 2001 10:30:41 +1200

 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 ]
 
 



More information about the Gcc-prs mailing list