newspaint

Documenting Problems That Were Difficult To Find The Answer To

Getting â Instead Of Quote Marks In GCC Output In Linux Using Putty

So you run gcc in your Linux terminal (through Putty) and instead of printing the single quote mark you get a funny-looking “a” character with a caret (upside-down V) on top:

gcc -c -Wall -O0 -g expand.c -o expand.o
expand.c: In function âfind_variableâ:
expand.c:1751:68: error: expected â)â before âSIZE_T_FMTâ
expand.c: In function âcompute_nhashâ:
expand.c:1423:3: warning: format â%dâ expects argument of type âintâ, but argument 2 has type âlong unsigned intâ [-Wformat]

How to fix this? You can either (but it will cause trouble trying to view man pages later):

myuser@myhost:~# export TERM=uxterm

Or you go Settings -> Window -> Translation in Putty and configure it for UTF-8. See this forum post.

Session Settings For UTF-8 in Putty

Session Settings For UTF-8 in Putty

Now you get:

gcc -c -Wall -O0 -g expand.c -o expand.o
expand.c: In function 'find_variable':
expand.c:1751:68: error: expected ')' before 'SIZE_T_FMT'
expand.c: In function 'compute_nhash':
expand.c:1423:3: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: