Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

encoding heuristic should be applied to first non-ASCII byte sequence

rather than to any byte sequence in the same chunk as the first non-ASCII byte
  • Loading branch information...
commit 1cca188becb125446059d4fa97e2d613ff668ef9 1 parent ccbfd74
@grantm grantm authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/Pod/Simple/BlackBox.pm
View
2  lib/Pod/Simple/BlackBox.pm
@@ -410,7 +410,7 @@ sub _try_encoding_guess {
return unless $line =~ /[^\x00-\x7f]/; # Look for non-ASCII byte
- my $encoding = $line =~ /[\xC0-\xFD][\x80-\xBF]/ ? 'UTF-8' : 'ISO8859-1';
+ my $encoding = $line =~ /^[\x00-\x7f]*[\xC0-\xFD][\x80-\xBF]/ ? 'UTF-8' : 'ISO8859-1';
$self->_handle_encoding_line( "=encoding $encoding" );
$self->{'_transcoder'} && $self->{'_transcoder'}->($line);
Please sign in to comment.
Something went wrong with that request. Please try again.