LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-24-2009, 12:07 PM   #1
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722
xterm garbage characters


I noticed that in xterm, a lot of characters are shown as "" instead of what's supposed to be there. This character often replaces the apostrophe in man pages and makes gcc error messages useless by turning the faulty code samples into garbage characters. This does not happen in gnome-terminal.

Here is a sample error from gcc, as shown in xterm:

Code:
error:  has no member named 
 
Old 09-24-2009, 12:38 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
This has to do with the LANG environment variable - type echo $LANG and you'll likely see something like:
en_US.UTF-8

If the terminal session you're using is not using that translation you'll see oddities. For example the default "translation" in PuTTY terminals is "ISO-8859-1:1998 (Latin-1, West Europe)". If you change it to be UTF-8 it matches the the shell variable mentioned above and gets rid of the garbage.

So the question is when you say "xterm" do you mean the xterm termtype (which is used in things like PuTTY and other emulators) or do you mean the actual "xterm" X Window program. If the latter you'll have to work out what your particular implementation is using for default translation.

Last edited by MensaWater; 09-25-2009 at 07:47 AM.
 
Old 09-24-2009, 05:48 PM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
It has to do with the LANG var and the unicode characteristics of your system. It also has to do with the FONT being used by your xterm.
 
Old 09-24-2009, 07:02 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722
Quote:
Originally Posted by jlightner View Post
So the question is when you say "xterm" do you mean the xterm termtype (which is used in things like PuTTY and other emulators) or do you mean the actual "xterm" X Window program. If the latter you'll have to work out what your particular implementation is using for default tranlation.
I am talking about an xterm window.
 
Old 09-25-2009, 07:56 AM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
Interesting - I just found a program called "luit" that will run your program with UTF-8. It came with xorg-x11-apps package so you likely have it as well.

Typing "luit man <manpage>" may solve your problem in an xterm window. Or maybe you need to launch it with "luit xterm". Both commands worked for me
 
Old 09-25-2009, 11:28 AM   #6
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722
launching a terminal using "luit xterm" didn't help.
 
Old 09-25-2009, 03:39 PM   #7
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
Did you try "luit man <manpage>"?
 
Old 09-25-2009, 07:37 PM   #8
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722
Didn't help either.

But I am more concerned about the compiler (because errors are rendered almost useless) than about man pages (where it is just a small nuisance).
 
Old 09-27-2009, 07:15 AM   #9
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
Did you verify LANG variable is set to UTF-8 (en_US.UTF-8)?

I recall having resolved similar issue some time ago by changing LANG variable to C:
export LANG=C
 
Old 09-27-2009, 07:31 AM   #10
massysett
LQ Newbie
 
Registered: Nov 2005
Location: Silver Spring, Maryland USA
Distribution: SUSE Linux 10.0
Posts: 17

Rep: Reputation: 1
I am having a similar problem:

http://www.linuxquestions.org/questi...rectly-758003/
 
Old 09-27-2009, 04:23 PM   #11
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722
Quote:
Originally Posted by jlightner View Post
Did you verify LANG variable is set to UTF-8 (en_US.UTF-8)?
How do you do that?
 
Old 09-27-2009, 04:26 PM   #12
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722
I figured it out, it's:

Code:
en_US.UTF-8
 
Old 09-28-2009, 08:55 AM   #13
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
To see what a variable is set to you do "echo $VAR" so in this case it would be "echo $LANG".

To change the variable do the "export LANG=C" I mentioned above. To change it back to the "export LANG=en_US.UTF-8"

Note these only change it for your current session. You'd have to modify your .bash_profile or .bashrc to make the change permanent. Don't do that until you determine if setting it at command line has resolved your issue.
 
Old 09-29-2009, 08:02 AM   #14
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722
I found that "export LANG=C" worked, but how do I make it permanent, and what is C?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
XTerm(241) support for truetype fonts and method of changing XTerm font. ajassat Linux - Software 2 08-19-2009 12:01 PM
Xterm and meta characters Khabi Linux - Software 1 09-20-2005 04:31 PM
garbage characters when switched to text mode allasso Linux - Software 0 01-24-2005 03:46 PM
Video garbage characters on RH9 boot kpenrod Linux - Hardware 5 10-26-2003 02:49 PM
Printer Paper-out Problem - Garbage Characters esage Mandriva 7 09-19-2003 06:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration