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: Zack Weinberg <zack at rabi dot columbia dot edu>
- Date: Mon, 21 Dec 1998 23:28:09 -0500
- 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
I like Paul's proposal in general but I have two nits relating to the
implementation.
>(1) The input character set is determined by #pragma charset FOO
> (or _Pragma ("charset FOO")) directive, compile-time option, or
> environment variable (in that order).
It is going to be extremely difficult to put _Pragma into the
preprocessor as it's specified in the current standard. I'll talk
about this in another message.
>(2) GCC uses the iconv function to translate from the input multibyte
> encoding to UTF-8 internally (for identifiers), and to determine
> character boundaries (in strings and comments).
To do this we'd need to translate the entire file to UTF-8 in order to
know where identifiers begin and end, and then translate strings
back. That can lose information - say strings are in ISO 2022-JP but
nothing else is.
zw