Help!

high-ascii characters in linux terminal via ssh

 
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Genreal Discussions RSS
Next:  udev rules syntax  
Author Message
Scott
External


Since: Aug 02, 2007
Posts: 5



PostPosted: Fri Aug 03, 2007 3:37 am    Post subject: high-ascii characters in linux terminal via ssh
Archived from groups: comp>os>linux>misc (more info?)

When I SSH into most of my newer linux machines from my windows
computer, I get some funny upper-ascii characters that appear from
time to time, particularly in manpages and gcc output. Here is a
randomly chosen snippet from a manpage:

Use --progress=dot to switch to the ‘‘dot’’ display.

The character sequences look like an 'a' with a hat over it and a
cursive upper case 'E'.

It's very annoying particularly with gcc output as these characters
end up around every identifier that appears in a gcc warning.

I've tried numerous different terminal emulation settings in my ssh
program to no avail. I'm sure I used to know how to turn this off (it
seems like there was an environment variable to set), but I forgot...
Can anyone remind me?

Thanks,
Scott
Back to top
Kenan Kalajdzic
External


Since: May 14, 2006
Posts: 11



PostPosted: Fri Aug 03, 2007 6:11 am    Post subject: Re: high-ascii characters in linux terminal via ssh [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Scott wrote:
> When I SSH into most of my newer linux machines from my windows
> computer, I get some funny upper-ascii characters that appear from
> time to time, particularly in manpages and gcc output. Here is a
> randomly chosen snippet from a manpage:
>
> Use --progress=dot to switch to the ??????dot?????? display.
>
> The character sequences look like an 'a' with a hat over it and a
> cursive upper case 'E'.
>
> It's very annoying particularly with gcc output as these characters
> end up around every identifier that appears in a gcc warning.
>
> I've tried numerous different terminal emulation settings in my ssh
> program to no avail. I'm sure I used to know how to turn this off (it
> seems like there was an environment variable to set), but I forgot...

You need to set the TERM environment variable in your login shell. If
you use putty, setting TERM to either "linux", "ansi" or "xterm" should
work fine in your case.

--
Kenan Kalajdzic
Back to top
Scott
External


Since: Aug 02, 2007
Posts: 5



PostPosted: Fri Aug 03, 2007 6:11 am    Post subject: Re: high-ascii characters in linux terminal via ssh [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> You need to set the TERM environment variable in your login shell. If
> you use putty, setting TERM to either "linux", "ansi" or "xterm" should
> work fine in your case.

No luck there, it doesn't seem to make any difference. The default is
vt100, which is what my ssh client is set to. I tried changing it
(both the term variable and the ssh client) to linux, ansi, and xterm
to no avail.

I did manage to find the previous "fix" for this issue, which was to
put:
export LANG="POSIX"
in my .bashrc file.

Strangely enough, this works for RHEL4, but on RHEL5, it changes the
funny characters to a string <E2><80><99>, which I'm assuming is the
hex values of the funny characters it was printing.
Back to top
Thomas Dickey
External


Since: Aug 09, 2006
Posts: 96



PostPosted: Fri Aug 03, 2007 2:49 pm    Post subject: Re: high-ascii characters in linux terminal via ssh [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Kenan Kalajdzic wrote:
>>
>> The character sequences look like an 'a' with a hat over it and a
>> cursive upper case 'E'.

.... UTF-8

>> I've tried numerous different terminal emulation settings in my ssh
>> program to no avail. I'm sure I used to know how to turn this off (it
>> seems like there was an environment variable to set), but I forgot...

> You need to set the TERM environment variable in your login shell. If
> you use putty, setting TERM to either "linux", "ansi" or "xterm" should
> work fine in your case.

$TERM is unrelated. It's the locale settings (man locale).

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Back to top
Scott
External


Since: Aug 02, 2007
Posts: 5



PostPosted: Fri Aug 03, 2007 3:54 pm    Post subject: Re: high-ascii characters in linux terminal via ssh [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> This is a consequence of a mismatched locale setting. The newer box is
> (probably) configured to use UTF8 but for some reason your pager doesn't
> know it.

Thanks for the info.

Now that I know what is causing it, I think I've fixed it by telling
my SSH client to use UTF-8 instead of 'default' which was what it was
configured to use.

Scott
Back to top
Chris Davies
External


Since: Apr 13, 2004
Posts: 371



PostPosted: Fri Aug 03, 2007 4:13 pm    Post subject: Re: high-ascii characters in linux terminal via ssh [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Scott wrote:
> When I SSH into most of my newer linux machines from my windows
> computer, I get some funny upper-ascii characters that appear from
> time to time, particularly in manpages and gcc output. Here is a
> randomly chosen snippet from a manpage:

> Use --progress=dot to switch to the €˜€˜dot€™€™ display.

> I've tried numerous different terminal emulation settings in my ssh
> program to no avail [...]

This is a consequence of a mismatched locale setting. The newer box is
(probably) configured to use UTF8 but for some reason your pager doesn't
know it.

For other people reading this post, you can probably reproduce it like
this (replacing en_GB.UTF8 with an appropriate locale):

LANG=en_GB.UTF8 man ls | LANG= less

To avoid it, you need to ensure that everything runs in the same locale.
So either remove LANG entirely, or ensure that it's set consistently
everywhere:

unset LANG # Maybe in your .profile / .bash_profile
man ls # Etc...

If you're using xterm windows anywhere, start using uxterm (or better,
lxterm) instead.

Chris
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Genreal Discussions All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum