Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: utf8 problems with Pod-ProjectDocs

by remiah (Hermit)
on Sep 25, 2012 at 01:24 UTC ( #995475=note: print w/replies, xml ) Need Help??

in reply to utf8 problems with Pod-ProjectDocs

I couldn't fully trace this, nor understand all. If you are going to have some trial, 4 lines of dirty patch to seems to me work.

1. decode $self->{buffer} to character. Add 2 lines

use Encode qw/decode/; $self->{buffer}=decode('UTF-8', $self->{buffer});
just after the line
$self->{buffer} = join "\n", qq[<div class="pod">], $self->{buffer}, " +</div>";
,which is in the "end_pos" sub.

2. encode $self->{buffer} back. Add 2 lines
use Encode(qw/encode/); $self->{buffer}=encode('UTF-8', $self->{buffer});
just after
,which is in "parse_from_file" sub.

before SUPER::parse_from_file, it has no troble. after SUPER::parse_from_file, it is troubled. "end_pos" is callback from Pod::Parser.

Replies are listed 'Best First'.
Re^2: utf8 problems with Pod-ProjectDocs
by LanX (Bishop) on Sep 25, 2012 at 11:02 UTC

    I recommended your patch to the maintainer of our installation. =)

    Cheers Rolf

Re^2: utf8 problems with Pod-ProjectDocs
by Anonymous Monk on Sep 23, 2013 at 09:10 UTC
    I think you got it the wrong way round: encode(...) in end_pod and decode(...) in parse_from_file works for me.


      I checked my test at that time, and I find no problems with Pod::ProjectDocs with no patch.
      I wonder whether this is fix of ProjectDocs, or Pod::Parser or my dream ???
      If you post your test case, I would like to check it. Mine was like this, and again, I see no problem now...

      #!/usr/bin/perl -w use strict; use warnings; use utf8; use lib './Pod-ProjectDocs-0.40/lib'; use Pod::ProjectDocs; my $pd = Pod::ProjectDocs->new( outroot => './out', libroot => './lib', title => '&#12503;&#12525;&#12472;&#12455;&#12463;&#12488;', lan =>'UTF-8', ); print "before gen\n"; $pd->gen();
      And target script in "lib"
      #!/usr/bin/perl =pod =head1 For POD TEST () =cut

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://995475]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2018-04-24 17:23 GMT
Find Nodes?
    Voting Booth?