This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: thoughts on martin's proposed patch for GCC and UTF-8
- To: Paul Eggert <eggert at twinsun dot com>
- Subject: Re: thoughts on martin's proposed patch for GCC and UTF-8
- From: Per Bothner <bothner at cygnus dot com>
- Date: Mon, 21 Dec 1998 18:45:09 -0800
- cc: rms at gnu dot org, amylaar at cygnus dot co dot uk, martin at mira dot isdn dot cs dot tu-berlin dot de, gcc2 at gnu dot org, egcs at cygnus dot com
> 1. Can autodetection work well enough to support non-"C" characters in
> strings and identifiers?
I don't know if it can work for C. I do know that autodectection
cannot work for Java. If a Java program is written in Latin-2,
then any non-Ascii characters have to be converted into the
corresponding Unicode at some stage in the translation process.
I.e. either the compiler or the assembler (or a pre-processor)
has to know the character set of the input file.
Yes, we could have auto-detection for C but not Java,
but that does seem rather clumsy.
In any case: I think we want to support linking together
source files written in different locales. E.g. libc
should be written in UTF-8, but an application may be written
in a local character set. If we want these to be able to link,
either the linker has to be able to convert between character
encodings (which I think we agree we don't want), or
symbol names in .o files have to be a common character set.
The only plauible contender for such a common character set
is UTF-8.
Given that symbols have to be in a common character encoding,
it follows that you cannot possibly do autodetection, at
least not for identifiers.
--Per Bothner
Cygnus Solutions bothner@cygnus.com http://www.cygnus.com/~bothner