views:

575

answers:

5

I'm accessing an ubuntu machine using PuTTY, and using gcc.

The default LANG environment variable on this machine is set to en_NZ.UTF-8, which causes GCC to think PuTTY is capable of displaying UTF-8 text, which it doesn't seem to be. Maybe it's my font, I don't know - it does this:

foo.c:1: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â at end of input

If I set it with export LANG=en_NZ, then this causes GCC to behave correctly, I get:

foo.c:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input

but this then causes everything else to go wrong. For example

man foo
man: can't set the locale; make sure $LC_* and $LANG are correct

I've trawled google and I can't for the life of me find out what I have to put in there for it to just use ascii. en_NZ.ASCII doesn't work, nor do any of the other things I can find.

Thanks

+4  A: 

LANG=en_NZ is correct. However, you must make locale files for en_NZ.

For Ubuntu, edit /var/lib/locales/supported.d/local and add en_NZ ISO-8859-1 to the file. If your system is another distribution (including Debian), the location will be different. Look at /usr/sbin/locale-gen and see where it stores this info.

Afterwards, run locale-gen to create the en_NZ locale file. Hope this helps!

Chris Jester-Young
+3  A: 

Putty can display utf - I think it is in appearance -> translation (or something, I don't have access to it right now).

Cebjyre
A: 

Thanks! Both answers solve the problem. I can't dish out any upvotes though due to the fscking vote limit.

Orion Edwards
A: 

I m getting the below error thm_proto.h:16: error: expected '=', ',', '; ', 'asm' or 'attribute' before 'void'

I dont have any clue to solve this compilation error... Everything is proper in code. I dont know what is missing in code.

vells
Use this link to ask a question: http://stackoverflow.com/questions/ask
Gleb
A: 

For Debian 5.0 Lenny:

aptitude install locales

If that's already installed:

dpkg-reconfigure locales
Drew R.