Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Problems? Is your data what you think it is?
 
PerlMonks  

PerlIO: crlf layer on Windows interfering with UCS-2 unicode

by almut (Canon)
on Apr 05, 2007 at 19:07 UTC ( #608532=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $filename = "test.ucs2le";
    open my $fh, ">:encoding(ucs-2le)", $filename
                 or die "Cannot open $filename for writing: $!";
    print $fh "\x{feff}\x{8765}\n\x{8765}\n";
    close $fh;
    
  2. or download this
     ff fe 65 87 0d 0a 00 65 87 0d 0a 00
    
  3. or download this
     ff fe 65 87 0d 00 0a 00 65 87 0d 00 0a 00
    
  4. or download this
    my $filename = "test.ucs2le";
    open my $fh, ">:encoding(ucs-2le)", $filename or die;
    my @layers = PerlIO::get_layers($fh); print "@layers\n";
    
  5. or download this
    unix crlf encoding(UCS-2LE) utf8
    
  6. or download this
    my $filename = "test.ucs2le";
    open my $fh, ">:raw:encoding(ucs-2le):crlf:utf8", $filename
                 or die "Cannot open $filename for writing: $!";
    print $fh "\x{feff}\x{8765}\n\x{8765}\n";
    close $fh;
    
  7. or download this
    unix encoding(UCS-2LE) utf8 crlf utf8
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://608532]
Approved by Corion
Front-paged by Joost
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (16)
As of 2014-04-23 20:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (554 votes), past polls