Skip to content

Commit

Permalink
Revert "Ensure utf8 flagged in $msgpack->utf8()"
Browse files Browse the repository at this point in the history
This reverts commit a3e918f.
  • Loading branch information
gfx committed Mar 27, 2012
1 parent 5b15717 commit a6e0ab9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
7 changes: 1 addition & 6 deletions lib/Data/MessagePack/PP.pm
Expand Up @@ -376,12 +376,7 @@ sub _unpack {
my $s = substr( $value, $p, $size );
length($s) == $size or _insufficient('raw');
$p += $size;
if($_utf8) {
utf8::decode($s);
if(!utf8::is_utf8($s)) { # latin-1
utf8::upgrade($s);
}
}
utf8::decode($s) if $_utf8;
return $s;
}
elsif ( $typemap[$byte] & $T_ARRAY ) {
Expand Down
7 changes: 0 additions & 7 deletions t/19_utf8_property.t
Expand Up @@ -26,13 +26,6 @@ use Encode qw(encode decode);
is ord($s), ord($latin1);
}

{
my $mp = Data::MessagePack->new()->utf8();

my $s = $mp->unpack( $mp->pack('foo') );

ok utf8::is_utf8($s), '(utf8-flag)';
}

done_testing;

1 change: 0 additions & 1 deletion xs-src/unpack.c
Expand Up @@ -264,7 +264,6 @@ STATIC_INLINE int template_callback_raw(unpack_user* u PERL_UNUSED_DECL, const c
*o = ((l==0) ? newSVpvs("") : newSVpvn(p, l));
if(u->utf8) {
sv_utf8_decode(*o);
if(!SvUTF8(*o)) sv_utf8_upgrade(*o);
}
return 0;
}
Expand Down

0 comments on commit a6e0ab9

Please sign in to comment.