I don't know where this is documented (I'm sure it must be somewhere), but having played with it a bit, it seems that perl's "UTF-16" (no "BE" or "LE") means "There needs to be a BOM at the start".

Perl will write a BOM on initial output to a file handle that is set for this encoding (and will use your machine's native byte order). On initial input, it will error out with "UTF-16:Unrecognized BOM xxxx" unless the first two bytes are either 0xFF 0xFE or 0xFE 0xFF. (And yes, if the first two bytes are one of those two pairings, it will use the given byte order.)


In reply to Re^2: Converting UTF-16 files to UTF-8 by graff
in thread Converting UTF-16 files to UTF-8 by demerphq

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.