Strange terminal behaviour

staticsafe me at staticsafe.ca
Wed Jan 9 21:44:19 UTC 2013


On 09/01/2013 4:14 PM, Nikhil Nair wrote:
> On Wed, 9 Jan 2013, staticsafe wrote:
> 
>> On 09/01/2013 1:44 PM, Nikhil Nair wrote:
>>> Hi there,
>>>
>>> I'm a recent convert to Ubuntu, using it on a remote server; the
>>> Linux-based server I have at home runs a very old version of Debian.  I
>>> connect from a Windows XP-based laptop running SecureCRT and/or PuTTY.
>>> I'm using a regular text-based terminal - not X Windows.
>>>
>>> I'm getting a strange problem with non-VT100 characters being used on
>>> the terminal, despite the TERM environment variable automatically being
>>> set to "vt100".  It's odd since, with identical Windows terminal setups
>>> when connecting to both machines, I get the issue on the Ubuntu machine
>>> but not on the Debian one.
>>>
>>> The easiest way to trigger this is by attempting to compile a C program
>>> with undefined references (e.g. a variable that wasn't declared), using
>>> gcc.  The single quotes around the variable name should be written as
>>> ordinary apostrophes, and that's what happens on the Debian box; but on
>>> the Ubuntu one, it's attempting to do something fancier: on PuTTY, they
>>> both look the same (they come out as an A circumflex...), whereas with
>>> SecureCRT, they're both displayed as three characters - the opening one
>>> is A circumflex, Euro, tilde, and the closing one is A circumflex, Euro,
>>> trademark.
>>>
>>> This sort of thing is more than a slight nuissance to me, as I'm blind,
>>> and these weird symbols mess with my screen reader.  They're even more
>>> of a problem in ncurses-style interfaces (several of which are used by
>>> configure scripts when installing packages...).
>>>
>>> All I've checked about the terminal setup, as yet, is the TERM
>>> environment variable, with is set to "vt100" on both machines.  I don't
>>> know enough about this sort of thing to know what to check next, or
>>> where to look up a solution in the documentation, so any help would be
>>> much appreciated!
>>>
>>> Thanks,
>>>
>>> Nikhil.
>>>
>>>
>>
>> Can you give us the output of the `locale` command on the Debian and the
>> Ubuntu box?
> 
> Sure.  I wasn't familiar with the locale command until just now, and
> only peripherally aware of the LC_* environment variables.  Results:
> 
> On the Ubuntu box:
> 
> LANG=en_GB.UTF-8
> LANGUAGE=
> LC_CTYPE="en_GB.UTF-8"
> LC_NUMERIC="en_GB.UTF-8"
> LC_TIME="en_GB.UTF-8"
> LC_COLLATE="en_GB.UTF-8"
> LC_MONETARY="en_GB.UTF-8"
> LC_MESSAGES="en_GB.UTF-8"
> LC_PAPER="en_GB.UTF-8"
> LC_NAME="en_GB.UTF-8"
> LC_ADDRESS="en_GB.UTF-8"
> LC_TELEPHONE="en_GB.UTF-8"
> LC_MEASUREMENT="en_GB.UTF-8"
> LC_IDENTIFICATION="en_GB.UTF-8"
> LC_ALL=
> 
> On the Debian box:
> 
> LANG=en_GB
> LC_CTYPE="en_GB"
> LC_NUMERIC="en_GB"
> LC_TIME="en_GB"
> LC_COLLATE="en_GB"
> LC_MONETARY="en_GB"
> LC_MESSAGES="en_GB"
> LC_PAPER="en_GB"
> LC_NAME="en_GB"
> LC_ADDRESS="en_GB"
> LC_TELEPHONE="en_GB"
> LC_MEASUREMENT="en_GB"
> LC_IDENTIFICATION="en_GB"
> LC_ALL=
> 
> 
> Do I take it that it's that "UTF-8" bit that's doing the mischief?
> 
> I've just switched the character encoding setting in SecureCRT, when
> connecting to the Ubuntu box, from default to UTF-8.  And, now, the
> apostrophes appear to be working correctly.  Much appreciated.
> 
> Is that, indeed, the best solution, would you suggest?
> 
> Cheers,
> 
> Nikhil.
> 
> 
Make sure your encoding is consistent across servers and between
terminal emulators, set Putty/SecureCRT to use UTF-8 and make sure the
locale on the servers are consistent as well.

To change locale on a server wide environment:

`sudo dpkg-reconfigure locales`

-- 
staticsafe
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org




More information about the ubuntu-users mailing list