in reply to Converting UTF-16 files to UTF-8
In Windows world the default "Unicode" encoding is UTF-16 little endian, which I'm guessing is what UltraEdit saves. However, in Perl's Encode world, "utf16" without a byte-order specified assumes big-endian by default so you need to say "utf16le" if you mean the other thing.
That said, it seems to me the presence of the BOM (which is mandatory) should mean, at least theoretically, that Perl could figure out for itself which one it is and it wouldn't go all kablooey. But I could be wrong.
Update: It occurs to me that I may have this entirely backwards. But I think the general idea is at least close - that is, you're saving the file in one byte order and Perl's reading it in another.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Converting UTF-16 files to UTF-8
by graff (Chancellor) on May 17, 2007 at 13:44 UTC |