Skip to content

Commit

Permalink
fatalize "utf8" warnings in Mojo::Util::decode, instead of using a $f…
Browse files Browse the repository at this point in the history
…allback
  • Loading branch information
Grinnz committed Sep 3, 2015
1 parent 5fed71e commit 07a4fd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Mojo/Util.pm
Expand Up @@ -99,10 +99,10 @@ sub decamelize {

sub decode {
my ($encoding, $bytes) = @_;
my $fallback = sub {die};
use warnings FATAL => 'utf8';
return undef
unless (UUTF8 and $encoding eq 'UTF-8')
? eval { $bytes = Unicode::UTF8::decode_utf8($bytes, $fallback); 1 }
? eval { $bytes = Unicode::UTF8::decode_utf8($bytes); 1 }
: eval { $bytes = _encoding($encoding)->decode("$bytes", 1); 1 };
return $bytes;
}
Expand Down

0 comments on commit 07a4fd1

Please sign in to comment.