Skip to content

Commit

Permalink
Merge branch 'encoding-warnings' into expect-chars
Browse files Browse the repository at this point in the history
  • Loading branch information
grantm committed Aug 11, 2012
2 parents 29306b7 + e2178e9 commit 18c3e79
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions lib/Pod/Simple.pod
Expand Up @@ -14,6 +14,8 @@ documentation") markup language that is typically used for writing
documentation for Perl and for Perl modules. The Pod format is explained
L<perlpod>; the most common formatter is called C<perldoc>.

Be sure to read L</ENCODING> if your Pod contains non-ASCII characters.

Pod formatters can use Pod::Simple to parse Pod documents and render them into
plain text, HTML, or any number of other formats. Typically, such formatters
will be subclasses of Pod::Simple, and so they will inherit its methods, like
Expand Down Expand Up @@ -322,6 +324,17 @@ Log an error unless C<< $parser->no_whining( TRUE ); >>.

=back

=head1 ENCODING

The Pod::Simple parser expects to read B<octets>. The parser will decode the
octets into Perl's internal character string representation using the value of
the C<=encoding> declaration in the POD source.

If the POD source does not include an C<=encoding> declaration, the parser will
attempt to guess the encoding (selecting one of UTF-8 or Latin-1) by examining
the first non-ASCII bytes and applying the heuristic described in
L<perlpodspec>.

=head1 CAVEATS

This is just a beta release -- there are a good number of things still
Expand Down
2 changes: 1 addition & 1 deletion lib/Pod/Simple/TranscodeSmart.pm
Expand Up @@ -32,7 +32,7 @@ sub make_transcoder {
my $x;
return sub {
foreach $x (@_) {
$x = Encode::decode($e, $x);
$x = Encode::decode($e, $x) unless Encode::is_utf8($x);
}
return;
};
Expand Down

0 comments on commit 18c3e79

Please sign in to comment.