Subject: | Forcing UTF8 causes formatting issues on slightly older groffs |
Date: | Sun, 27 May 2012 03:30:15 -0400 |
To: | bug-pod-perldoc [...] rt.cpan.org |
From: | Chris Nehren <c.nehren [...] shadowcat.co.uk> |
Not all systems have a bleeding edge groff available, and not all
systems are capable of handling UTF8 yet. This means the unconditional
forcing of the utf8 flag in lib/Pod/Perldoc/ToMan.pm line 141 causes
formatting issues. This looks like a remnant of a commit bdfoy made some
years ago that also unconditionally set the UTF8 flag (without checking
*at all* that the system was actually capable of dealing with the
results). This either needs to be wrapped in some conditionals or
removed. It looks like the code tries to do this but doesn't actually do
a very good job of it.
With that line present, the current Pod-Perldoc git HEAD renders this:
PERL(1) User Contributed Perl Documentation PERL(1)
NAME
perl - The Perl 5 language interpreter
SYNOPSIS
perl [<C2> -sTtuUWX<C2> ] [<C2> -hv<C2> ]<C2> [<C2> -V[:configvar]<C2> ]
[<C2> -cw<C2> ]<C2> [<C2> -d[t][:debugger]<C2> ]<C2> [<C2> -D[number/list]<C2> ]
[<C2> -pna<C2> ]<C2> [<C2> -Fpattern<C2> ]<C2> [<C2> -l[octal]<C2> ]<C2> [<C2> -0[octal/hexadecimal]<C2> ]
[<C2> -Idir<C2> ]<C2> [<C2> -m[-]module<C2> ]<C2> [<C2> -M[-]'module...'<C2> ]<C2> [<C2> -f<C2> ]
[<C2> -C<C2> [number/list]<C2> ] [<C2> -S<C2> ] [<C2> -x[dir]<C2> ]
[<C2> -i[extension]<C2> ]
[<C2> [-e|-E]<C2> 'command'<C2> ]<C2> [<C2> --<C2> ]<C2> [<C2> programfile<C2> ]<C2> [<C2> argument<C2> ]...
If I comment out that line, I get the much nicer:
PERL(1) User Contributed Perl Documentation PERL(1)
NAME
perl - The Perl 5 language interpreter
SYNOPSIS
perl [ -sTtuUWX ] [ -hv ] [ -V[:configvar] ]
[ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]
[ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ]
[ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ]
[ -C [number/list] ] [ -S ] [ -x[dir] ]
[ -i[extension] ]
[ [-e|-E] 'command' ] [ -- ] [ programfile ] [ argument ]...
I will note that my system is quite capable of handling UTF-8 (have a
snowman: ☃), and therefore it's my (slightly) out of date groff that is
the issue. I have confirmed this by installing a new groff, uncommenting
the problematic line, and running perldoc with -n $PATH_TO_NEW_GROFF. I
would rather not install a separate groff (and its dependencies) to cope
with a buggy Perl library that can be fixed by removing one erroneous
line of code.
--
Chris Nehren | Coder, Sysadmin, Masochist
Shadowcat Systems Ltd. | http://shadowcat.co.uk/