From: Jarkko Hietaniemi Date: Mon, 9 Jun 2003 18:45:00 +0000 (+0000) Subject: Possible fix for the problems in EBCDIC from Sadahiro Tomoyuki. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b8d10bc1834937e1787fda13c581aeed3260e660;p=p5sagit%2Fp5-mst-13.2.git Possible fix for the problems in EBCDIC from Sadahiro Tomoyuki. p4raw-id: //depot/perl@19726 --- diff --git a/ext/Unicode/Normalize/Normalize.pm b/ext/Unicode/Normalize/Normalize.pm index 14c121a..7dbe42e 100644 --- a/ext/Unicode/Normalize/Normalize.pm +++ b/ext/Unicode/Normalize/Normalize.pm @@ -35,27 +35,12 @@ our %EXPORT_TAGS = ( 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;