Question

How can I get mojibake to pass? this might be a bug in the contributors plugin. The character does not render correctly in perldoc, but does in my vim and in the extracted git log.

#   Failed test 'Mojibake test for blib/lib/Pod/Spell.pm'
#   at /home/xenoterracide/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Test/Mojibake.pm line 168.
# Non-UTF-8 unexpected in blib/lib/Pod/Spell.pm, line 431 (POD)

here's a snippet from the source which should probably be looked at directly due to copy-paste maybe not catching an encoding issue.

=item *

Olivier Mengué <dolmen@cpan.org>

=back

A little more vim exploration shows that :set filencoding is being changed to latin1 editing the file in vim seems to fix this, but since the file is being generated, how can I get it generated with the correct encoding?

Was it helpful?

Solution

The short answer is that Dist::Zilla is not yet utf-8 clean (read more here - https://github.com/rjbs/Dist-Zilla/issues/212). The long answer depends on what plugins you are using, and in what configuration, as it is often possible to get your dist to come out right, even though the core is doing things incorrectly.

I'd suggest changing your pod encoding to ISO-8859-1 for now, as that's probably the form that the characters are taking in the output file.

That is, in your weaver.ini:

[-Encoding]
encoding = ISO-8859-1

If that fails (it's quite possible you have both utf8 and latin1 chars showing up in your .pm file), you'll have to remove [Test::Mojibake] for now.

RJBS says this should be fixed in Dist::Zilla version 5

If you have a non default weaver.ini, after upgrading to Dist::Zilla 5 and Pod::Weaver 4, you'll need to add the following to your weaver.ini to have =encoding utf8 added

[-SingleEncoding]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top