This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/3804: Extended ASCII "wide" characters not behaving with UTF-8 locale
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: c/3804: Extended ASCII "wide" characters not behaving with UTF-8 locale
- From: Markus Kuhn <Markus dot Kuhn at cl dot cam dot ac dot uk>
- Date: Wed, 25 Jul 2001 22:42:59 +0100
- Cc: neil at gcc dot gnu dot org
On 25 Jul 2001 neil@gcc.gnu.org wrote:
> Your second item is not the way GCC is heading. GCC will not
> interpret translation units based upon locale settings
If this is true, it is very disappointing. I work myself in a
en_GB.UTF-8 locale and I very much wished that the compiler would
interpret the files I supply to it in a way compatible to my terminal
emulator (xterm), editor (vim), etc. all already do, namely according to
the current locale. This would finally give me a WYSIWYG scenario, where
I can use UTF-8 just as easily as ASCII without any special
arrangements. Just like the C inventors have been practising it on Plan9
for a decade now!
All GNU applications really should be designed such that if you decide
one morning to follow Plan9 and finally turn everything into UTF-8, then
all you have to do is add something "export LC_CTYPE=en_GB.UTF-8" to
/etc/profile, run iconv once over all your plaintext files and filenames,
and everything works from then on right out of the box in UTF-8 now.
Everything, except for gcc is seems. Sad. :-(
http://www.cl.cam.ac.uk/~mgk25/unicode.html#activate
If gcc ignores the locale, this also does not conform to the holly
standard. ISO/IEC 9899:1999(E) says in ยง6.4.4.4:
[#11] A wide character constant has type wchar_t, an integer
type defined in the <stddef.h> header. The value of a wide
character constant containing a single multibyte character
that maps to a member of the extended execution character
set is the wide character corresponding to that multibyte
character, as defined by the mbtowc function, with an
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
implementation-defined current locale.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3804&database=gcc
Markus
--
Markus G. Kuhn, Computer Laboratory, University of Cambridge, UK
Email: mkuhn at acm.org, WWW: <http://www.cl.cam.ac.uk/~mgk25/>