On Fri, 28 Oct 2005 07:13:39 -0700 (PDT), rajarshi das <[EMAIL PROTECTED]> wrote

> Hi,
> On EBCDIC, I get the following results on perl-5.8.6 : 
>  
> @t1 = unpack("aU0C/UU", "b\0\341\277\274");
> print "t1 : @t1\n";
>  
> @t2 = unpack("aU0C/CU", "b\0\341\277\274");
> print "t2 : @t2\n";
>  
> Gives : 
> t1 : b 0
> t2 : b 0
>
> Are these results correct ? 
>  
> Thanks,
> Rajarshi.

\341\277\274 is well-form UTF-8 but is not well-form UTF-EBCDIC.
(It is obviously ill-form since all of these three octets are leading
 octets of multi-octet sequences; there is no trailing octet).

You cannot expect that perl would handle UTF-8 as characters on EBCDIC,
since perl uses UTF-EBCDIC for character representation on EBCDIC.

Oppositely perl does not handle UTF-EBCDIC as characters on ASCII,
since perl uses UTF-8 for character representation on ASCII.

*Of course both UTF-8 and UTF-EBCDIC strings can be regarded
 as octet sequences.

Regards,
SADAHIRO Tomoyuki


Reply via email to