perl-unicode

Re: data written on ebcdic

2005-07-08 12:28:42
Rajarshi Das <dazio_r(_at_)yahoo(_dot_)com> writes:
I run the following on an ebcdic platform
(perl-5.8.6), 

$BOM = chr(0xFEFF);
open(UTF_PL, ">:raw:encoding(utf16le)", "utf.pl")
       or die "utf.pl($enc,$tag): $!";
print UTF_PL $BOM;
print UTF_PL "1";



should the data that is written using PerlLIO_write,
be "\xFF \xFE \xF1" or should it be "\xFF \xFE \x31" ?

If you run that on an EBCDIC machine the "1" will know it is 0xF1 in 
"bytes" mode. But encoding(utf16be) should "upgrade" from EBCDIC to Unicode 
before writing to disk. So IMO you _should_ get octents 
"\xFF \xFE \x31" in the file.


<Prev in Thread] Current Thread [Next in Thread>