Bug 331561 - Examples cut-n-pasted from man pages fail because of quotes
Summary: Examples cut-n-pasted from man pages fail because of quotes
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-WWW-Mechanize
Version: 7
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Marcela Mašláňová
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-10-14 22:58 UTC by Penelope Fudd
Modified: 2008-05-05 13:43 UTC (History)
3 users (show)

Fixed In Version: perl-5.10.0-1.f9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-05 13:43:57 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Penelope Fudd 2007-10-14 22:58:35 UTC
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

How reproducible:
Every time

Steps to Reproduce:
1. man WWW::Mechanize
2. cut-n-paste the example into a file
3. try running it
  
Actual results:
The single-quotes are not recognized and have to be replaced.  Very tedious.

Expected results:
It should use the regular single-quotes.

Additional info:
I'm using LANG=en_US.UTF-8 , the default.

Comment 1 Ivana Varekova 2007-10-15 06:45:21 UTC
This man-page is a part of perl-WWW-Mechanize package, so I'm reassigning this
bug to it.

Comment 2 Penelope Fudd 2007-10-15 06:55:30 UTC
Dude....

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.

Comment 3 Penelope Fudd 2007-10-15 06:57:48 UTC
Oh, varekova didn't get comment #2.  Could someone with more bugzilla-foo fix that?

Thanks!

Comment 4 Ivana Varekova 2007-10-15 07:21:03 UTC
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.

Comment 5 Marcela Mašláňová 2007-10-15 08:03:24 UTC
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
(ASCII 0x60).

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.

Comment 6 Jan Pazdziora 2007-10-15 08:44:37 UTC
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 

=head1 Test

Testing

        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
0000074
$ 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                        
0000300                                                                
0000320       2   0   0   7   -   1   0   -   1   5                    
0000340                                                                
0000360                           T   E   S   T   (   1   )  \n
0000376

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"
.SH "Test"
.IX Header "Test"
Testing
.PP
.Vb 1
\&        perl -le 'print 1'
.Ve
.PP
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.

Comment 7 Jan Pazdziora 2007-10-15 09:02:21 UTC
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.

Comment 8 Jan Pazdziora 2007-10-25 07:30:36 UTC
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.

Comment 9 Marcela Mašláňová 2008-05-05 13:43:57 UTC
It looks it was fixed. There was some code changing in perl-5.10 in pod part.


Note You need to log in before you can comment on or make changes to this bug.