tags:

views:

735

answers:

3

For some reason, my installation of gcc seems to be printing an "a with a carat" character in place of all %s's in its error messages, e.g.,

test.c:4: error: expected â, â, â, â or â before â token

Has anyone else seen this before? (Needless to say, it's difficult to Google for.)

(This is on Ubuntu 8.10)

Edit: The guy at http://ubuntuforums.org/showthread.php?t=252832 says to set LC_MESSAGES=en_US but that doesn't do anything for me.

+4  A: 

What is your LANG-Settings (call "export" on a bash in a terminal)? Try setting the Lang to a correct value like

LANG="en_US.UTF-8"

using

declare -x LANG="en_US.UTF-8"

This seems to be a charset-problem, so perhaps you want to double-check using the right one.

theomega
I already have LANG=en_US.UTF-8 :(
mike
Aha! That was actually the problem. I'll post the answer.
mike
+1  A: 

Seems like madness to me, but I just wanted to put in that you may be able to Google for it more easily by calling the ^ a circumflex, which is what it's usually called when used as an accent.

chaos
You're right -- I'm getting closer: http://mlblog.osdir.com/lib.gnulib.bugs/2005-09/msg00100.shtml
mike
+4  A: 

Aha! The problem was that I have LANG=en_US.UTF-8 and was using xterm. Apparently, that's no good. By setting LANG=C or LANG=en_US, everything's great now.

mike
you should accept the answer given by theomega then.
The.Anti.9
Yes. The problem was that GCC gave UTF8 messages, while xterm can't handle them. You could use a more modern terminal and stick with UTF8 if you want.
ypnos
@Anti9: No, theomega's answer was the opposite of what I should do.
mike