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?
 
Annihilannic, the export LC_ALL=C definitely did something:

--color[=WHEN]
control whether color is used to distinguish file types. WHEN
may be <E2><80><98>never<E2><80><99>, <E2><80><98>always<E2><80>
<99>, or <E2><80><98>auto<E2><80><99>

It highlighted the, I assume hex, chars that it couldn't figure out.

And you're right, the paste did screw up the NROFF. Now the following works:

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

Looks like you're getting there, but did I do something wrong with the LC_ALL?


 
Did you remember to use man -c ls to force it to reformat the page?

Annihilannic.
 
Annihilannic, yeah the following works whether LC_ALL is set or not:

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


I've experienced this behavior when I’ve run across a bad quote in my data using perl (as in the first quote in never). And I’ve used notepad to change all bad quotes to good quotes, and problem solved. In the above ‘never’, the leading quote is different than the trailing quote, and I bet that’s at least one of the problems. I'm not sure how to, or if I should do that here. What do you think?

 
It isn't a "bad quote" as such in Perl, it just has special meaning, i.e. $var = `ls`; would put the output of the ls command into the variable $var. It is usually referred to as a "backquote".

It should have no special meaning on a man page, so in theory it shouldn't be a problem (and I wouldn't recommend you start modifying man pages).

I'd guess your man -c is now working because you've left the modified NROFF line in /etc/man.config?

Annihilannic.
 
As an aside, one REALLY needs to be carefull with backquotes (`) and ticks ('). A lot of text processing tools mess them up and this can wreck havoc when you copy something and put it in a configuration script. I ran into this with some MySQL script files that were copied from a Wordpress blog.

 
Annihilannic, yes I left NROFF in config, and man -c does work, BUT I don't think man is the only problem with this system, because I ran a compile on 4Js 4gl code and sysout also had garbage. Although I generally don't compile the apps on this box, it still shouldn't have done it. So I'm not sure where all, this will show up. Again, I want to thank you for staying with me on this!!!
 
Noway2, indeed... and also anything that has ever been anywhere near Microsoft Word with its autoformatting "features" such as making quotes into opening and closing pairs will suffer a similar fate.

Good point ejaggers, but I have no convenient way to reproduce that particular problem, so I'm not sure what to advise.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top