FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 01-06-2010, 08:37 AM
"Boyd Stephen Smith Jr."
 
Default 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/ \_/
 
Old 01-06-2010, 01:19 PM
Stephen Powell
 
Default What is the right way to fix LANG or locale such that quotes appear properly?

On 2010-01-06 at 00:13:40 -0500, 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.)
>
> 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:~#
>
> What is the right way to fix this problem?

When you first launch PuTTY, you get the PuTTY Configuration
menu. Typically, you click on a pre-saved session under
"Saved Sessions", click the "Load" button to load that profile,
then click on "Open" to start your terminal session.

Follow this procedure instead. Click on a pre-saved session under
"Saved Sessions", click the "Load" button to load that profile,
but do *not* click on "Open". Instead, move the mouse pointer over
the "Category" section on the far left. There should be four major
sub-sections there: Session, Terminal, Window, and Connection.
Move down to the "Window" section. If it has a plus sign (+) next
to it, single left click on the plus sign to turn it into a minus sign,
or hyphen (-). This will expose the sub-sections under the Window
Subsection. If "Window" already has a hyphen next to it, then
the sub-sections under it will already be exposed. You should now
see a "Translation" sub-section under "Window". Single left click
on "Translation".

Now look over on the right side. You should see a section called
"Character set translation on received data", under which is a
drop-down menu titled "Received Data Assumed to be in which character
set". Single left click on the drop-down arrow on the right and
pick something from the menu that matches the language/locale that
the Debian server is using.

Now move the mouse pointer back over to the Category section.
Single left click on "Session". Now single left click on the
"Save" button under "Load, Save, or Delete a stored session".
Now click on "Open" to launch your terminal session.

Hope this helps.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 09:48 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org