Red Hat Bugzilla – Bug 331561
Examples cut-n-pasted from man pages fail because of quotes
Last modified: 2008-05-05 09:43:57 EDT
Description of problem:
Cutting-and-pasting of examples from man pages fails, because the characters
used for single quotes is not acceptable to perl.
Version-Release number of selected component (if applicable):
perl-WWW-Mechanize-1.30-2.fc7 for instance
Steps to Reproduce:
1. man WWW::Mechanize
2. cut-n-paste the example into a file
3. try running it
The single-quotes are not recognized and have to be replaced. Very tedious.
It should use the regular single-quotes.
I'm using LANG=en_US.UTF-8 , the default.
This man-page is a part of perl-WWW-Mechanize package, so I'm reassigning this
bug to it.
That was only an example. I tried it with a *lot* of man pages, and the man
program is converting both ` and ' into some unicode-ish single quote.
For instance, man tcsh.
And man zsoelim.
And just about every ***ing man page on the system that has a single quote in it.
Don't pass this off to someone else, because I don't think there's a bugzilla
option for selecting everyone with a man page.
Thanks for your attention.
Oh, varekova didn't get comment #2. Could someone with more bugzilla-foo fix that?
Oops thank you this is not perl-WWW-Mechanize but it is not man-page problem
too, groff is the package which is used to display man-pages. So reassigning again.
I've just looked in the "man 7 groff" and here is:
Single Character Escapes:
\’ The acute accent ´; same as \(aa. Unescaped: apostrophe, right quotation
mark, single quote (ASCII 0x27).
\‘ The grave accent `; same as \(ga. Unescaped: left quote, backquote
So the problem is in every man page, which have ` instead of \`. This problem
isn't occured in package man-page as I see.
For example tcsh -> "rpm -qf /usr/share/man/man1/tcsh.1.gz"
give us: tcsh-6.15-1.fc8
I reassign it back to perl-WWW-Mechanize, you can reassign it to particular
packages, if you want.
The problem is that if you have a POD document with a simple apostroph (\047),
when you convert it to man page, that apostrophe gets changed to \342\200\231.
$ cat test.pod
perl -le 'print 1'
End of testing
$ od -c test.pod
0000000 \n = h e a d 1 T e s t \n \n T e
0000020 s t i n g \n \n \t p e r l - l e
0000040 ' p r i n t 1 ' \n \n E n d
0000060 o f t e s t i n g \n \n
$ perldoc test.pod | od -c
0000000 T E S T ( 1 )
0000020 U s e r C o n t r
0000040 i b u t e d P e r l D o c u
0000060 m e n t a t i o n
0000100 T E S T ( 1 ) \n \n
0000120 \n \n T \b T e \b e s \b s t \b t \n
0000140 T e s t i n g \n \n
0000160 p e
0000200 r l - l e 342 200 231 p r i n t
0000220 1 342 200 231 \n \n E n d
0000240 o f t e s t i n g \n \n \n \n p
0000260 e r l v 5 . 8 . 8
0000320 2 0 0 7 - 1 0 - 1 5
0000360 T E S T ( 1 ) \n
When I run simple
$ pod2man test.pod
it still has the correct apostophe there:
.IX Title "TEST 1"
.TH TEST 1 "2007-10-15" "perl v5.8.8" "User Contributed Perl Documentation"
.IX Header "Test"
\& perl -le 'print 1'
End of testing
It's only after
$ pod2man test.pod | nroff -man
when it gets changed.
So, either nroff is doing something nasty, trying to be clever and changing
characters when it shouldn't, or nroff's behaviour is documented and alright,
and then probably pod2man should do some more quoting/escaping/tweaking to
produce output which nroff will process without changing the characters.
So, I've been pointed to groff_char(7) and to the fact that if we need to get
"normal" apostrophe to the output in nroff, it has to be written as \(aq. So we
probably need a change to Pod::Man to produce \(aq instead of that simple single
apostrophe to the output.
There is similar problem with the pipe char (|, \x7c). When processed through
pod2man | nroff -man, there is \xe2\x94\x82 (or 342 224 202 in octal) on the output.
It looks it was fixed. There was some code changing in perl-5.10 in pod part.