Neil Williams writes:
Why is the utf-8 switch optional in your patch? Is there a problem with
using UTF-8 by default for all builds? If there is, then relying on a
mystery directory containing _build isn't going to be a usable solution.
Oh, it wasn't a real patch. It was my way of generating valid man pages
to check them before committing my translation update to repository.
The point of the switch is to catch only the generated files, but not
the original ones, to add the `=encoding UTF-8' line to them. I've added
the switch after my first attempt of working around the problem had
broken a lot of files in my local copy of po4a.
I can make it a configuration setting in the po4a-build.conf file - the
question is which way should it default? UTF-8 on or off?
If depends on the encoding of a document, and should be on when po4a
generates an UTF-8 file, and off otherwise. It shouldn't be very hard to
find out the encoding of translated documents, but the original,
English, documents might require a configuration option (I can bet such
an option would be off for most English documents).
I think the =encoding line should be added by po4a itself, not
po4a-build. Without such a line pod2man will never generate correctly
encoded UTF-8 man page, quoting pod2man(1):
Be aware that, when using this option, the input encoding
of your POD source must be properly declared unless it is
US-ASCII or Latin-1. POD input without an "=encoding"
command will be assumed to be in Latin-1, and if it's
actually in UTF-8, the output will be double-encoded.
>
_build::pod::3::pUseriC_build::pod::3::pl::lib::Locale::Po4a::Man(3)
That's something else to fix in po4a - it doesn't go wrong with the
untranslated manpage.
Possibly a bug in pod2man, when generating the .IX and .TH ?
I've just found the following comment in /usr/share/perl/5.10.1/Pod/Man.pm:
#...... Lose
# anything up to the first off:
#
# */lib/*perl*/ standard or site_perl module
# */*perl*/lib/ from -Dprefix=/opt/perl
# */*perl*/ random module hierarchy
#
# .......
# and strip off an initial component of "lib" or "blib/lib" since
And po4a-build calls pod2man like this:
pod2man lib/Locale/Po4a/Text.pm _build/po4a/man/man3/Locale::Po4a::Text.3
for the original files, and accordingly to the above comment the initial
lib gets stripped, but for the translation the call is:
pod2man _build/pod/3/pl/lib/Locale/Po4a/Text.pm
_build/po4a/man/pl/man3/Locale::Po4a::Text.3
Looks like the appearance of 'pl' in the middle, breaks some reg exp
that pod2man uses to build the .IX.
Possibly changing pl to perl would be sufficient. OTOH you know the name
of the man page, why can't you use it and call e.g.:
pod2man -s 3 --name Locale::Po4a::Text other_args
Regards,
robert