Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
don't stringify values passed to UUTF8
  • Loading branch information
Grinnz committed Sep 3, 2015
1 parent f63e6fe commit 5fed71e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Mojo/Util.pm
Expand Up @@ -102,7 +102,7 @@ sub decode {
my $fallback = sub {die};
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, $fallback); 1 }
: eval { $bytes = _encoding($encoding)->decode("$bytes", 1); 1 };
return $bytes;
}
Expand All @@ -118,7 +118,7 @@ sub dumper {

sub encode {
(UUTF8 and $_[0] eq 'UTF-8')
? Unicode::UTF8::encode_utf8("$_[1]")
? Unicode::UTF8::encode_utf8($_[1])
: _encoding($_[0])->encode("$_[1]");
}

Expand Down

0 comments on commit 5fed71e

Please sign in to comment.