On Thu, 3 Apr 2003 20:50:27 +0200 (CEST)
"Matthias Herlitzius" <[EMAIL PROTECTED]> wrote:

> $infile = "infile.xml";
> $outfile = "outfile.xml";
> 
> open my $in,  "<:encoding(UTF-16LE)", $infile  or die;
> open my $out, ">:encoding(UTF-16LE)", $outfile or die;
> 
> while (<$in>) {
>       print $out $_;
> }
> 
> close ($out);
> close ($in);

The automatical CRLF <==> LF conversion in the text mode
should be avoided.
(remember binmode() has been and will be used for binary mode.)

:raw:encoding(UTF-16LE) instead of encoding(UTF-16LE)
may resolve this problem. (if I am not mistaken...)

open my $in,  "<:raw:encoding(UTF-16LE)", $infile  or die;
open my $out, ">:raw:encoding(UTF-16LE)", $outfile or die;

Regards,
SADAHIRO Tomoyuki

Reply via email to