>>>>> "Markus" == Markus Kuhn <[EMAIL PROTECTED]> writes:
>> Yes, but only if the compiler is gcc, and no "coding:" marker is at
>> the top of the file, and no overruling command line option has been
>> given.
Markus> Why does gcc not simply follow the standard POSIX rules and
Markus> use nl_langinfo(CODESET) to determine the encoding of source
Markus> code from the encoding?
I'd like to know the answer to this too. gcj, the Java front end to
gcc, does exactly this. It also has a `--encoding' option that you
can use to override the default. So for instance we build the gcj
runtime with `--encoding=UTF-8', because we know our files are encoded
that way.
Markus> About the ugly "coding:" marker convention
One problem with C that Java doesn't have is that the encoding for
headers can be different from the encoding for your program. So for
instance system headers might be UTF-8 while your program might be
SJIS (or whatever). (In Java the "header" files are .class files,
which are pretty well specified.)
One way to solve this problem is the `coding:' marker. (I dislike
this.)
Another way would be to simply specify that system headers must have a
fixed encoding, and user headers must match the sources.
Yet another way would be to add a way for the --encoding flag to
affect -I flags -- that is, attach the encoding to directories. This
is an extension of the fixed-system-encoding idea.
Tom
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/linux-utf8/