This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: thoughts on martin's proposed patch for GCC and UTF-8


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]