Matt Sergeant <[EMAIL PROTECTED]> writes:

> --- Encode.pm.old     Fri Sep  7 10:08:03 2001
> +++ Encode.pm Mon Sep 10 15:17:17 2001
> @@ -667,11 +667,11 @@
>  to transfer strings in this form (e.g. to write them to a file) would
>  need to
>  
> -     pack('L',map(chr($_),split(//,$string)));   # native
> +     pack('L',map(ord($_),split(//,$string)));   # native
>    or
> -     pack('V',map(chr($_),split(//,$string)));   # little-endian
> +     pack('V',map(ord($_),split(//,$string)));   # little-endian
>    or
> -     pack('N',map(chr($_),split(//,$string)));   # big-endian
> +     pack('N',map(ord($_),split(//,$string)));   # big-endian
>  
>  depending on the endian required.

Doesn't it make sense to change the pack specifier into L*, V*, and N*
too.  And would it not be much faster to do:

   pack("L*", unpack("U*", $string));
   pack("V*", unpack("U*", $string));
   pack("N*", unpack("U*", $string));

Regards,
Gisle

Reply via email to