Hi,
 
I met a problem when writing to a file with 'encoding(utf16le)' in Activeperl 5.8.2 (and 5.8.4) for Windows.  My code is as follows,
 
open(my $_orig_file, "<:encoding(utf16le)", "..\\drom_src\\unicode.txt") or die "Can't open DROM original!\n";
open(my $_raw_file, ">:encoding(utf16le)", "..\\drom_src\\unicode2.txt") or die "Can't open DROM raw file!\n";
print $_raw_file "\x{FEFF}";
 
while (<$_orig_file>)
{
    s/^\x{FEFF}// if (/^\x{FEFF}/);
 
    print $_raw_file $_;
}

# The file unicode.txt is exactly encoded in UTF-16 Little Endian.
I ran the above code in my Windows XP (SP1), and the content of the resulting unicode2.txt is in a mess.
 
However, I tried to run it in Perl 5.8.2 (and 5.8.5) for Cygwin in the same Windows XP (SP1) platform, the result is right.
 
Is it a bug of Activeperl 5.8.2/4?
 
Thanks & best regards,
Zhou Yu


************* Email Confidentiality Notice ********************

The information contained in this e-mail message (including any attachments) may be confidential, proprietary, privileged, or otherwise exempt from disclosure under applicable laws. It is intended to be conveyed only to the designated recipient(s). Any use, dissemination, distribution, printing, retaining or copying of this e-mail (including its attachments) by unintended recipient(s) is strictly prohibited and may be unlawful. If you are not an intended recipient of this e-mail, or believe that you have received this e-mail in error, please notify the sender immediately (by replying to this e-mail), delete any and all copies of this e-mail (including any attachments) from your system, and do not disclose the content of this e-mail to any other person. Thank you!
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to