non-ASCII error messages from gcc

Berna Massingill bmassing at cs.trinity.edu
Sat Oct 1 09:37:30 UTC 2005


On Wed, Sep 28, 2005 at 06:03:16AM -0400, Jakub Jelinek wrote:

>>  On Wed, Sep 28, 2005 at 04:56:09AM -0500, Berna Massingill wrote:
>>  > On FC2 (and earlier RedHat) systems, error messages from gcc seem
>>  > to have been straight ASCII.  On a couple of FC4 systems, output
>>  > includes some non-ASCII characters; specifically, the characters
>>  > used for single quotes (previous ` and ') have been replaced by
>>  > something multi-byte.  (I base this claim on redirecting stderr
>>  > into a file and then displaying file contents with "od -c".)
>>  > The sequence that replaces ' displays okay, but the sequence that
>>  > replaces ` does not (appears as boldface u with umlaut).
>>  > 
>>  > My guess is that there's an environment variable somewhere that's
>>  > not getting set quite right; the man page for gcc seems to be
>>  > indicating that what gets produced for error messages is controlled
>>  > by environment variables LANG and LC_MESSAGES.  LC_MESSAGES is unset;
>>  > LANG is set to en_US.UTF-8.
>>  
>>  It is LC_CTYPE that tells the compiler what the display character set is.
>>  If LC_ALL nor LC_CTYPE is present in the environment, ctype defaults
>>  to $LANG (if set), otherwise to C.
>>  If your terminal can't display UTF-8 encoded characters, then I guess
>>  you shouldn't be using UTF-8 character set...
>>  
>>  Works just fine here in FC4 both on the console and in gnome-terminal.

(Sorry about the delay in responding; I wanted to check behavior on
a couple of different systems.)

Interesting ....  

I would have said "isn't a text console a text console, and they all
work the same way?" but apparently not -- on one system I use, I get
the weird symptom I describe, while on another I don't.  I guess it
does make a kind of sense given that the two systems have different
video hardware and presumably use different drivers.

Terminal emulations (gnome-terminal and xterm) seem to be fine on
both systems.

Setting LC_CTYPE=C on the badly-behaving system makes the annoying
symptom go away.  I would not have guessed from the description in
the gcc man page that this would have any effect on how error
messages are formatted.

Thanks for the help!

-- blm




More information about the fedora-list mailing list