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



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


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