Help for this page

Select Code to Download


  1. or download this
    #!/usr/local/perl/5.15.8/bin/perl -w
    
    ...
    
    open my $out, ">:crlf:encoding(UTF-16LE)", $fname or die;
    print $out "\x{feff}\x{1234}\n\x{5678}\n";
    
  2. or download this
    $ ./test-out.pl
    $ hexdump foo.utf16 
    0000000 feff 1234 0a0d 7800 0d56 000a          
    000000c
    
  3. or download this
    $ hexdump foo.utf16 
    0000000 feff 1234 000d 000a 5678 000d 000a     
    000000e
    
  4. or download this
    #!/usr/local/perl/5.15.8/bin/perl -w
    use Devel::Peek;
    ...
    open my $in, "<:crlf:encoding(UTF-16LE)", $fname or die;
    $/ = undef;
    Dump <$in>;
    
  5. or download this
    $ ./test-in.pl
    SV = PV(0x77dc60) at 0x953728
    ...
      PV = 0x829130 "\357\273\277\341\210\264\r\n\345\231\270\r\n"\0 [UTF8
    + "\x{feff}\x{1234}\r\n\x{5678}\r\n"]
      CUR = 13                                ^               ^
      LEN = 14