in reply to Unicode strangeness
Here is one solution:
use strict; use warnings; use charnames ':full'; open(my $fh, ">:raw", "test.plp"); binmode($fh, ":encoding(ucs2le)"); print $fh "\r\n"; close $fh; #test open(PLP,"<:encoding(ucs2le)","test.plp"); my $string; sysread(PLP, $string, 100); printf("0x%02x ", ord($_)) for (split //, $string);
This prints:
0x0d 0x00 0x0a 0x00
Your original problem is due to the fact that there is a :crlf layer, and the sequence between layers.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unicode strangeness
by Odud (Pilgrim) on Oct 16, 2005 at 13:46 UTC |