Tested on Windows XP. Neither worked. However the thought is definitely very decent. I probably know where your thought came from: in the old days, :raw reverses :crlf, but it no longer does.
use strict; use warnings; use charnames ':full'; open( my $fh, ">:raw:encoding(ucs2le):crlf", "test.plp" ); print $fh "\N{CARRIAGE RETURN}\N{LINE FEED}"; close $fh; #test open(PLP,"<","test.plp"); my $string; sysread(PLP, $string, 100); printf("0x%02x ", ord($_)) for (split //, $string);
This prints:
0x0d 0x00 0x0d 0x00 0x0a 0x00
use strict; use warnings; use charnames ':full'; open( my $fh, ">:encoding(ucs2le):crlf", "test.plp" ); print $fh "\N{CARRIAGE RETURN}\N{LINE FEED}"; close $fh; #test open(PLP,"<","test.plp"); my $string; sysread(PLP, $string, 100); printf("0x%02x ", ord($_)) for (split //, $string);
This prints:
0x0d 0x00 0x0d 0x0a 0x00
In reply to Re^2: Unicode strangeness
by pg
in thread Unicode strangeness
by Odud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |