Re: UTF-8 not working in Pod::Simple::HTML

[email protected] (Shawn H Corey) Sat, 12 May 2012 19:32:31 -0400
Newsgroups perl.pod-people
Message-ID <[email protected]>
On 12-05-12 07:16 PM, Grant McLean wrote:
> On Sat, 2012-05-12 at 11:53 -0400, Shawn H Corey wrote:
>> I'm trying to use Pod::Simple::HTML to convert PODs into HTML but my
>> voilĂ  becomes voil&#65533;
>
> That is very odd output, but I was unable to reproduce your problem with
> the supplied code snippet.  I added a bit of boilerplate to turn it into
> this complete standalone script - which also does not exhibit the
> problem:
>
> === start script ===
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use Pod::Simple::HTML;
>
> my @lines =<DATA>;
>
> my $parser = Pod::Simple::HTML->new();
> $parser->output_string( \my $html );
> $parser->set_source( \@lines );
> $parser->run();
>
> print $html, "\n";
>
> __DATA__
>
> =encoding UTF-8
>
> =head1 TEST
>
> voilĂ 
>
> === end script ===
>
> This script outputs:<p>voil&#224;</p>
>
> If I omit the =encoding line the output is broken in a different way:
> <p>voil&#195;&#160;</p>
>
> Regards
> Grant
>

Thanks. Apparently, this line doesn't work.

   use open qw( :encoding(utf8) :std );

I didn't included it in my OP since it did seem relevant. I wished Perl 
would work with UTF-8 without any bother. :(


-- 
Just my 0.00000002 million dollars worth,
   Shawn

Programming is as much about organization and communication
as it is about coding.

[updated for today's programming]
"Show me your code and conceal your interfaces, and I shall continue
to be mystified. Show me your interfaces, and I won't usually need
your code; it'll be obvious."
	-- Fred Brooks

CPAN http://www.cpan.org/
The world's largest repository of software;
all of it tested; all of it free.