On Fri Nov 12 15:10:56 2010, DWHEELER wrote:
Show quoted text> Hey there agentzh, any luck finding this code?
I got annoyed by this today, too, and so used your test to write a quick test. There are a few
problems with this, though:
* It disables the use of HTML::Entities. We could instead pass a second argument to it,
`'<>&"'`, but that would probably be best to do *only* if the string being encoded has the
utf8 flag set.
* Even if we were to do that, the default content-type meta header declares the charset as
ISO-8859-1. We should probably consider changing that, anyway.
* But we may *not* want to do that if any string is encoded that neither has the utf8 flag set
nor contains only ASCII characters. Then, well, who knows what it's encoding would be? We
really want to discourage mystery encodings, of course, and have people put the
`=encoding` tag in their Pod, but there will be cases where that's not done, and then what?
* Even if we do decide to go whole hog and force everything to be UTF-8 (which I could easily
get on board with), we run into the problem of supporting older Perls. Pod::Simple requires
Perl 5.0.0. Not 5.6, not 5.4, not 5.8, but 5.0! For proper encoding support, we'd have to
seriously consider dumping everything before 5.6, and, ideally perhaps, even before 5.8.1.
Maybe we could consider doing that just for the XHTML generator? Then we'd have to be
pretty careful to write the tests in a compatible way.
* This ignores the HTML output. Maybe that's a good thing, too?
Honestly, Pod::Simple::XHTML generates pretty good HTML now. One can get around all these
problems in any one usage by doing something like this:
use Pod::Simple::XHTML;
$Pod::Simple::XHTML::HAS_HTML_ENTITIES = 0;
my $psx = Pod::Simple::XHTML->new;
$psx->html_header_tags('<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />');
And then making sure it applies only to Pod files that properly declare their encoding. Since I
think it'd be quite a bit of work to rework Pod::Simple for smarter encoding, Maybe that's
good enough for now?
Comments?
Best,
David