[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#197375: gcj dies en parsing java code with high ASCII values in it



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi...
On Sun, 15 Jun 2003 08:30 pm, you wrote:
> Peter Hawkins wrote:
> > I've never touched the locale on my systems, so it's the default
> > (LANG="C"?)
>
> Please invoke locale(1) to be sure.

Yup, all of the listed locales are "C".

>
> I don't see this as a problem. Please find the documentation of the JDK
> that explains in detail how the encoding of source code files is
> determined. The gcj approach is very clear (use the locale's encoding),
> so if the JDK is different, it must be the JDK that is broken.

Well, surely the function of the 'javac' wrapper script is to provide as exact 
an emulation of the JDK command of the same name as possible. (That's why it 
exists, if you didn't want JDK semantics, then you wouldn't be using the 
wrapper script, right?) So we should try to emulate (possibly broken) 
semantics correctly.

> The encoding of the C locale most definitely must *not* be Latin-1. If
> you want characters outside the POSIX "portable character set", use a
> different locale.

I'm not arguing this for invocations of 'gcj'. I'm arguing it for invocations 
of 'javac'. When I run javac, in an ideal world, it would do as close to the 
same thing no matter whether I was using the JDK or GCJ. Therefore the 
default in this case should be the same as whatever default the JDK would 
pick. If no encoding is specified, I'd like javac to explicitly specify the 
default according to whatever the policy the jdk uses, or as close as we can 
approximate it.

>
> In general, relying on defaults for source code encodings is also bad,
> so always specify the encoding explicitly.

Agreed, and that's what I'll do in this case. But I'd prefer that the default 
behaviour was the same as that of the JDK.

You can feel free close this bug if you also apply the patch I sent before 
which fixes the parsing of the -encoding option in the javac wrapper so it's 
actually possible to pass a locale =)

=)
Peter

>
> Regards,
> Martin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+7Gh6XjDfzL4R9DcRAlAeAJ9AhRef5sfpOGPbjf4eTG1BCKtdeACfY/He
6YpowT9KH0XoGoecLmtQGic=
=GOqB
-----END PGP SIGNATURE-----




Reply to: