Question

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

Was it helpful?

Solution

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!

OTHER TIPS

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

For Debian 5.0 Lenny:

aptitude install locales

If that's already installed:

dpkg-reconfigure locales
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top