CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
unicode utf-16le CR-LF problem

 



b4swine
New User


Oct 9, 2006, 10:41 AM

Post #1 of 1 (3522 views)
unicode utf-16le CR-LF problem Can't Post

When you output utf-16, every char should be 2 (or perhaps 4 bytes long). But if any of the 16-bit chars contains a \x0a byte, that LF will be expanded to a CR-LF, destroying all unicodicity. Can't figure out how to do 'binary mode' output with unicode.

Help!


Code
$_ = "\x{ff0a}\x{1234}"; 

open OUT, ">temp.txt";
binmode OUT, ":encoding(UTF-16le)";
print OUT;
close OUT;

# The output file contains five bytes: 0D 0A FF 34 12


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives