in reply to Unicode strangeness
Another way to try would be one of the following (I'm not sure which because again, I don't have a windows box to try it on):
# either this: open( my $fh, ">:encoding(ucs2le):crlf", "filename" ); # or if that doesn't work, then this: open( my $fh, ">:raw:encoding(ucs2le):crlf", "filename" );
In either case, by putting ":crlf" after the encoding spec, the crlf layer (converting "\n" in your code to "\r\n" on output) will create proper 16-bit renderings of the CR and LF characters (0d 00 0a 00).
It does seem unfortunate that this is not the default behavior.
(updated to fix spelling error in code sample)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unicode strangeness
by pg (Canon) on Oct 16, 2005 at 00:40 UTC | |
by graff (Chancellor) on Oct 16, 2005 at 02:55 UTC |