Niko Tyni <[EMAIL PROTECTED]> writes:

> I see. The Perl internal encoding is UTF-8, but there are ways to get
> invalid UTF-8 in there, for example by using :utf8 on binary input.
> This invalid UTF-8 will then be output as-is with if :utf8 is set on
> output.
>
> I can't really think of a case where setting :encoding(utf-8) on output
> does the right thing but :utf8 doesn't. It does turn the output into valid
> UTF-8, but do you have an example where the content is not gibberish?

I can't easily duplicate what I was seeing now, but I was getting output
that was not UTF-8 while using that output encoding in combination with
Pod::Simple.  I'm not quite sure what was going on.  It's possible that I
had made some mistake in the middle of my testing, though.

> How about providing your own parse_from_file() wrapper in Pod::Man that
> knows about the utf8 option, does the open() and then sets the binmode?

I guess I could do that, but I think I disagree with this:

> I don't think there's any need to touch the filehandles of people using
> parse_file().

I would prefer not to touch the filehandle, but I don't think it's
acceptable to say that if you're using the utf8 option, you still have to
set up output encodings yourself.  Maybe I'm overreacting to how difficult
I found this area of Perl to understand, but I'd really rather that
Pod::Man and Pod::Text do the right thing without requiring people
understand Perl's very strange Unicode handling.

Pod::Text also has to do something more complex in order to preserve its
traditional encoding agnosticism if utf8 is not given.

-- 
Russ Allbery ([EMAIL PROTECTED])             <http://www.eyrie.org/~eagle/>



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to