bootstrap Unicode::Normalize $VERSION;
-use constant UNICODE_FOR_PACK => "A" eq pack('U', 0x41);
-use constant NATIVE_FOR_PACK => "A" eq pack('U', ord("A"));
-
-use constant UNICODE_FOR_UNPACK => 0x41 == unpack('U', "A");
-use constant NATIVE_FOR_UNPACK => ord("A") == unpack('U', "A");
-
sub pack_U {
- return UNICODE_FOR_PACK
- ? pack('U*', @_)
- : NATIVE_FOR_PACK
- ? pack('U*', map utf8::unicode_to_native($_), @_)
- : die "$PACKAGE, a Unicode code point cannot be stringified.\n";
+ return pack('U*', @_);
}
sub unpack_U {
- return UNICODE_FOR_UNPACK
- ? unpack('U*', shift)
- : NATIVE_FOR_UNPACK
- ? map(utf8::native_to_unicode($_), unpack 'U*', shift)
- : die "$PACKAGE, a code point returned from unpack U " .
- "cannot be converted into Unicode.\n";
+ return unpack('U*', pack('U*').shift);
}
use constant COMPAT => 1;