This is the mail archive of the 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]
Other format: [Raw text]

Re: UTF-8 quotation marks in diagnostics

On Wed, 21 Oct 2015, Martin Sebor wrote:

> That would go against the usual (i.e., POSIX) expected effect
> of the environment variable.  Specifically for GCC (or the c99
> utility), POSIX requires LC_CTYPE to determine the locale used
> to parse the input, and LC_MESSAGE to determine the locale of
> diagnostic messages.  If the c99 utility on your system doesn't
> honor that I would recommend opening a bug.

LC_MESSAGES determines "the language and cultural conventions in which 
messages should be written" (not necessarily the interpretation of 
multibyte characters in that output).  (If an explicit character set is 
specified for LC_MESSAGES that's different from that in LC_CTYPE, you 
probably have a broken environment - multibyte characters need to have a 
consistent interpretation throughout the process - note for example that 
printf-family functions, when they do conversions for output, do so using 
LC_CTYPE, and expect the format to be a valid multibyte string in the 
LC_CTYPE locale.  That said, there may be a case for gcc_init_libintl more 
closely emulating what gettext/libintl's get_output_charset does, e.g. 
regarding checking OUTPUT_CHARSET before nl_langinfo (CODESET).  "The 
locale settings of individual categories cannot be truly independent and 
still guarantee correct results.")

Joseph S. Myers

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