Re: [PATCH] Encode.pm docs fix
Gisle Aas [Mon, 10 Sep 2001 11:27:02 +0000 (04:27 -0700)]
Message-ID: <lrwv363nrd.fsf@caliper.ActiveState.com>

p4raw-id: //depot/perl@11994

ext/Encode/Encode.pm

index 6a297a3..2aee7c1 100644 (file)
@@ -667,13 +667,13 @@ can be considered as being in this form without encoding. An encoding
 to transfer strings in this form (e.g. to write them to a file) would
 need to
 
-     pack('L',map(ord($_),split(//,$string)));   # native
+     pack('L*', unpack('U*', $string));  # native
   or
-     pack('V',map(ord($_),split(//,$string)));   # little-endian
+     pack('V*', unpack('U*', $string));  # little-endian
   or
-     pack('N',map(ord($_),split(//,$string)));   # big-endian
+     pack('N*', unpack('U*', $string));  # big-endian
 
-depending on the endian required.
+depending on the endianness required.
 
 No UTF-32 encodings are implemented yet.