Skip Menu |

This queue is for tickets about the Pod-Usage CPAN distribution.

Maintainer(s)' notes

Please use Github for all future tickets, patches and pull requests: https://github.com/Dual-Life/Pod-Usage

Thanks to Nicolas R (ATOOMIC) for setting up everything there!

Report information
The Basics
Id: 101538
Status: resolved
Worked: 30 min
Priority: 0/
Queue: Pod-Usage

People
Owner: Marek.Rouchal [...] gmx.net
Requestors: david [...] weintraub.name
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.65



Subject: Pod::Usage doesn't handle E<copy> correctly
Date: Wed, 14 Jan 2015 08:07:20 -0500
To: bug-Pod-Usage [...] rt.cpan.org
From: David Weintraub <david [...] weintraub.name>
On a utf8 system, Pod::Usage doesn’t handle E<copy> correctly. This becomes 0xA9 rather than multibyte 0xCA:0xA9. Other symbols are also handled incorrectly Version: 1.6.1 Perl version: 5.18.1 OS: Mac OS X 10.10 (Yosemite) Pod::Html correctly translates the copyright symbol as &copy;. There are other problems too. Sample POD: =head1 test: =over 4 =item B<copy> E<copy> =for Incorrect =item B<amp> E<amp> =for Correct =item B<thorn> E<thorn> =for Incorrect =item B<yuml> E<yuml> =item B<Alpha> =for Incorrect E<Alpha> =item B<Gama> =for Incorrect E<Gamma> =item B<alpha> =for Incorrect E<alpha> =item B<gamma> E<gamma> =for Incorrect =item B<trade> E<trade> =for Incorrect =item B<foo> E<foo> =for Error (Displays error correctly) =back
RT-Send-CC: RRA [...] cpan.org, FLORA [...] cpan.org, KJALB [...] cpan.org, TOMC [...] cpan.org
Pod::Usage uses Pod::Text for formatting the output, including the translation of E<...> to the output stream. When redirecting the output to a file (pod2usage -out ...), and opening the file in a good editor, at least some of the entities are shown correctly. It's still not perfect, but it shows that some results also depend on the capabilities of the terminal emulator... and that will be hard to fix, since it requires exact knowledge of the capabilities of all possible terminal emulators out there... ouch! @podlators: would you care to take this ticket? Cheers, Marek
CC: FLORA [...] cpan.org, KJALB [...] cpan.org, TOMC [...] cpan.org
Subject: Re: [rt.cpan.org #101538] Pod::Usage doesn't handle E<copy> correctly
Date: Tue, 10 Feb 2015 18:42:06 -0800
To: "Marek Rouchal via RT" <bug-Pod-Usage [...] rt.cpan.org>
From: Russ Allbery <rra [...] cpan.org>
"Marek Rouchal via RT" <bug-Pod-Usage@rt.cpan.org> writes: Show quoted text
Show quoted text
> Pod::Usage uses Pod::Text for formatting the output, including the > translation of E<...> to the output stream. When redirecting the output > to a file (pod2usage -out ...), and opening the file in a good editor, > at least some of the entities are shown correctly. It's still not > perfect, but it shows that some results also depend on the capabilities > of the terminal emulator... and that will be hard to fix, since it > requires exact knowledge of the capabilities of all possible terminal > emulators out there... ouch!
Show quoted text
> @podlators: would you care to take this ticket?
Well, from the perspective of podlators, it's up to the caller to say what output character set you want. There is unfortunately no really great way to detect the desired output character set; the default is to use the same output encoding as was used for the input encoding, for historical reasons and backward compatibility. So, basically, podlators has the same problem that you have, and I don't think is really in a better place to address it. If you want UTF-8 from Pod::Text, just construct the Pod::Text object with utf8 => 1. (Command line: pod2text -u.) You may want to consider adding such an option to Pod::Usage and pass the buck up an additional level, although I admit that's rather unfortunate. (That said, there isn't a generalized capability to specify the output encoding at present, just utf8 or the default passthrough behavior. That's something I'd like to add.) -- #!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker $^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD, 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{ rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
RT-Send-CC: RRA [...] cpan.org
I will implement Russ' suggestion to specify a "UTF-8" option in Pod::Usage (the module and the pod2usage script) - that's however all I can do on my end...
pod2usage now has a utf8 option - this might work better. But the underlying translation of E<...> happens in Pod::Text anyway...