[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: What is the right way to fix LANG or locale such that quotes appear properly?



On Tuesday 05 January 2010 23:13:40 Foss User wrote:
> On my terminal (PuTTY terminal), I see that the quotes are displayed
> incorrectly. They appear as a with a caret over it. Here is an output:
> 
> debian:~# echo $LANG
> en_IN
> debian:~# gcc a.c
> a.c: In function âmainâ:
> a.c:6: error: âasâ undeclared (first use in this function)
> a.c:6: error: (Each undeclared identifier is reported only once
> a.c:6: error: for each function it appears in.)

Most likely the charset/encoding used by the en_IN locale is not what your 
terminal is expecting.  I'm not sure what the default charset/encoding is for 
en_IN.  However, most terminal software has support for unicode/utf-8 and may 
default to it.  If that's the case with puTTY (IIRC, it is), you might try 
using the en_IN.utf8 locale instead, and configuring your terminal to expect 
utf-8 and render unicode.

> Currently, I am fixing by changing the LANG to en_US like this:
> 
> debian:~# export LANG=en_US
> debian:~# gcc a.c
> a.c: In function 'main':
> a.c:6: error: 'as' undeclared (first use in this function)
> a.c:6: error: (Each undeclared identifier is reported only once
> a.c:6: error: for each function it appears in.)
> debian:~#

en_US usually does not need characters outside of the (7-bit) ASCII character 
set, and many charset/encoding combinations are compatible with (7-bit) ASCII.  
This results in en_US rendering the vast majority of characters correctly no 
matter what your terminal is expecting.

There are a few less-used characters in the en_US locale, most notably the 
one-half faction, the one-quarter fraction, the copyright symbol, and the 
trademark and registered trademark symbols.  If your terminal is expecting 
unicode/utf-8, it will not render these correctly in the en_US locale, but 
will in the en_US.utf8 locale.

<rant stlye="addled bemoaning">
Locales, Character Sets, and Character Encodings are a bit of a pain.  (7-bit) 
ASCII works almost everywhere, but anything outside of that range depends on 
everything in the chain between your terminal and the program you are running 
to be in-sync.  I know, I have 2 UNIX "jump boxes", 2 different versions of 
GNU screen, and 2 different implementations of SSH between my terminal 
(Konsole for KDE 4) and the Linux system I edit code on.  Heaven forbid I try 
and use the applications I'm modifying (say, to test), since they *require* 
the use of function keys and use a pre-curses-standardization library for 
"graphical" text-mode user-interfaces.
</rant>
-- 
Boyd Stephen Smith Jr.           	 ,= ,-_-. =.
bss@iguanasuicide.net            	((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy 	 `-'(. .)`-'
http://iguanasuicide.net/        	     \_/

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: