Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird characters in sysout/syserr 1

Status
Not open for further replies.

ejaggers

Programmer
Feb 26, 2005
148
0
0
US
My new Redhat 5.3 system prints weird characters to the screen. i.e.

Some, but not all of the lines in the man pages:


man ls

-C list entries by columns

--color[=WHEN]
control whether color is used to distinguish file types. WHEN
may be ?Çÿnever?ÇÖ, ?Çÿalways?ÇÖ, or ?Çÿauto?ÇÖ


Output from a compiler:

Gchd80m.ec:443: warning: incompatible implicit declaration of built-in function
ÇÿstrncpyGÇÖ
schd80m.ec: In function GÇÿinit_conflict_logGÇÖ:
Gchd80m.ec:591: warning: incompatible implicit declaration of built-in function
ÇÿstrcpyGÇÖ
Gchd80m.ec:624: warning: incompatible implicit declaration of built-in function
ÇÿstrstrGÇÖ
schd80m.ec: In function GÇÿbuild_matrixGÇÖ:
Gchd80m.ec:798: warning: incompatible implicit declaration of built-in function
ÇÿstrlenGÇÖ

Does anyone know what’s wrong?
 
Not sure. It looks as if either 1 - you are experiencing some sort of hardware failure or file corruption, or 2 - you have defined the wrong unicode format for your system.
 
What exactly do you mean by "screen"? Which terminal software are you using? Does it happen on the console as well? What is your $TERM set to?

What's the output of locale?

Annihilannic.
 
Annihilannic (MIS)

TERM=vt100, by screen I mean, I'm telneted in to RHEL box.

what do you mean, "What's the output of locale?
 
Are you using telnet from the Windows command-line or something? If so it has very ordinary terminal emulation (althought it should at least manage vt100 alright)... you'd probably have more luck using something like PuTTY. Also Telnet is not a secure protocol, consider using SSH (which PuTTY also supports).

By the output of locale, I mean type in that command and let us know what it prints...

Annihilannic.
 
Annihilannic, here is locale:

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
 
That looks pretty straightforward... and my other question about which terminal emulator you're using?

Did you have any luck with PuTTY (or one of the many other alternatives...)?

Annihilannic.
 
It took staring at it a while, but the weird characters remind me a lot of what a baud rate mis-match looks like over a serial port.

What type of physical connection are you using to telnet into your RH box?

 
Looks more to me like terminal control characters to set bold, turn bold off, etc. but they appear to be for the wrong terminal type, or an emulator that doesn't handle them properly. They appear in positions that are too regular to be baud rate issues in my opinion.

Annihilannic.
 
Annihilannic, I'm not sure what terminal emulator I'm using, because I thought telnet/vt100 was it. How can I find out.
And what do you mean, turn off bold.

Noway2, I don't know about the physical connection.
 
Well, you must be logged in to your Red Hat system from another one if you are using telnet, right? So what system are you logged in from? A Windows box? How did you open the telnet session? From the command prompt? By loading another telnet client (Reflection or something like that?) There are many such clients; the one that comes with Windows is very basic, but it does the job.

I wasn't suggesting you should turn off bold. When you are logged in through telnet, it sends special characters to your terminal emulator telling it when it should display bold characters, normal characters, underlined characters, etc. If your terminal emulator doesn't understand them (for example, if they are for the wrong terminal type), then it will just display the special characters instead of making the appropriate formatting changes.

Annihilannic.
 
Annihilannic, I'm telneting via a shortcut on my desktop, using XP/SP3.
 
I tried putty and got this:


--color[=WHEN]
control whether color is used to distinguish file types. WHEN
may be âneverâ, âalwaysâ, or âautoâ

 
Okay... it's not Windows... and it's not your telnet client.

Red Hat seem to have made a bit of a mess of things... it seems like nroff which is used to handle the formatting of man pages is not correctly handling characters such as ' and `.

The solution is here:


Annihilannic.
 
Annihilannic, Thanks for staying with me on this issue. I really do appreciate it. Unfortunately, the fix above did not work.
 
My gut feel is that the telnet client has a terminal setting that doesn't match the servers terminal setting.
For example, your $TERM is vt100 but maybe your telnet client is expecting VT52 or ANSI or something.


Trojan.
 
TWB, that was my feeling too, but I can reproduce it on both RHEL53 and RHEL46 with PuTTY/telnet/Cygwin SSH. Can you confirm that it works as expected for you on those distributions? The --color section on man ls that ejaggers pointed out is a good litmus test. I've opened a Red Hat bug about this, so any additional info would be useful.

ejaggers, make sure the line you add looks like this:

Code:
NROFF /usr/bin/groff -Tlatin1 -mandoc

For some reason when I tested just now and pasted that line in it ended up with .mandoc instead of -mandoc.

Also you may need to remove the file /var/cache/man/cat1/ls.1.bz2 because the formatted man pages are cached, therefore the change above won't take effect until the next time the formatting is done.

For me it now looks like this:

Code:
       --color[=WHEN]
              control  whether  color is used to distinguish file types.  WHEN
              may be `never', `always', or `auto'

Instead of this:

Code:
       --color[=WHEN]
              control  whether  color is used to distinguish file types.  WHEN
              may be âneverâ, âalwaysâ, or âautoâ

Annihilannic.
 
Hmm... I think it's locale related. If I use LC_ALL=C man -c ls it's fine.

Incidentally, the -c option is equivalent to removing the cached man page, it forces a reformatting.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top