theory/pod-simple — pull request #30 by grantm (2012-05-30 11:22:43+00:00)
Title: silently skip transcoding step if passed a characters rather than bytes

The 3.21 and 3.22 releases caused problems for our friends at metacpan.org.

The root cause of the problem they were seeing is that their code calls decode_utf8() on the POD source before passing it to Pod::Simple. The Pod::Parser however is designed to accept byte strings and not character strings. A fatal error results when Pod::Simple asks Encode.pm to decode a string that already contains decoded UTF8 characters.

This commit updates Pod::Simple::TranscoderSmart to silently skip the the decode step if the POD source string is already a character string (i.e.: is_utf8() returns true). I have confirmed that this works around the specific issue with the metacpan indexer.

I was tempted to issue a warning in these circumstances, but decided that my earlier patches add enough extra noise for now :-)