Skip Menu |

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

Report information
The Basics
Id: 26702
Status: resolved
Priority: 0/
Queue: Pod-POM-Web

People
Owner: DAMI [...] cpan.org
Requestors: chris+rt [...] chrisdolan.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.03
Fixed in: 1.05



Subject: [PATCH] utf-8 charset
Modules with non-ASCII text in their POD (like Spiffy.pm whose author is Ingy döt Net) are rendering incorrectly. The following trivial patch corrects this for me (Mac Firefox). --- /Users/chris/perl/lib/perl5/site_perl/Pod/POM/Web.pm 2007-04-24 15:16:17.000000000 -0500 +++ lib/Pod/POM/Web.pm 2007-04-26 01:56:59.000000000 -0500 @@ -704,7 +708,7 @@ sub send_content { my ($self, $args) = @_; my $length = length $args->{content}; - my $mime_type = $args->{mime_type} || "text/html"; + my $mime_type = $args->{mime_type} || "text/html; charset=utf-8"; my $modified = gmtime $args->{mtime}; my $code = $args->{code} || 200;
The proposed patch would not work in all cases, because sometimes (or even frequently for somebody like me in a french-speaking country), the pod is in Latin-1, not UTF-8. So generating the proper header is not a problem; but the problem is to decide which encoding was used in the pod source. Anybody knows how to do that ? For Perl source code, we could detect if there is a "use utf8" or "use encoding whatever", but in plain POD there is no such thing ...
Subject: Re: [rt.cpan.org #26702] [PATCH] utf-8 charset
Date: Wed, 2 May 2007 19:31:01 -0500
To: bug-Pod-POM-Web [...] rt.cpan.org
From: Chris Dolan <chris [...] chrisdolan.net>
On May 2, 2007, at 7:29 AM, via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=26702 > > > The proposed patch would not work in all cases, because sometimes (or > even frequently for somebody like me in a french-speaking country), > the pod is in Latin-1, not UTF-8. > > So generating the proper header is not a problem; but the problem is > to decide which encoding was used in the pod source. Anybody knows how > to do that ? For Perl source code, we could detect if there is a "use > utf8" or "use encoding whatever", but in plain POD there is no such > thing ...
Yeah, that makes sense. I forgot that Perl defaults to Latin-1. Too much Java lately, I guess. :-) Chris -- Chris Dolan, Equilibrious LLC, http://equilibrious.net/ Public key: http://chrisdolan.net/public.key vCard: http://chrisdolan.net/ChrisDolan.vcf