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

Bryce McKinlay
Sun Mar 18 14:20:00 GMT 2001 wrote:

> >Fix:
> Thanks to Bryce McKinlay, I added the 2 following files
> and near
> the existing files and
> and added these two file in:
>       src/cvs/gcc/libjava/
>       src/cvs/gcc/libjava/

Cool, thanks. I'll look at checking those in shortly.

> But these 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 --main=Hello
$ ./a.out
Liberté, égalité, fraternité !
$ gcj --encoding=UTF-8 --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?


  [ bryce ]

More information about the Java-patches mailing list