in reply to Re^2: Understanding pack and unpack changes for binary data between 5.8 and 5.10
in thread Understanding pack and unpack changes for binary data between 5.8 and 5.10

with 5.10, you'd get [...] the low-byte values of the codepoints, with the high-byte part being truncated. With warnings enabled, you also get "Character in 'H' format wrapped in unpack at...".

It's odd that it doesn't warn or croak with "Wide character in ...".

If you want to dump the internal buffer,

use Encode qw( _utf8_off ); sub internal { _utf8_off( my $s = shift ); return $s; } my $s = "\x{1234}\x{5678}"; # string with utf8 flag on print unpack("H*", internal($s)), "\n";

Update: Fixed error identified in reply.

  • Comment on Re^3: Understanding pack and unpack changes for binary data between 5.8 and 5.10
  • Download Code

Replies are listed 'Best First'.
Re^4: Understanding pack and unpack changes for binary data between 5.8 and 5.10
by almut (Canon) on Mar 11, 2009 at 16:23 UTC
    utf8::_utf8_off( my $s = shift );

    I think you meant Encode::_utf8_off(...).