Microsoft Visual Studio (up to 2008, don’t have 2010 so can’t test it) don’t support unicode correctly.
They expect to see UTF-16LE encoded text (must have the correct format BOM too).
If you present them with UTF-16BE (with the correct BOM) then they corrupt the file by assuming it’s LE encoded.
This means that a file written using perl with the :encoding(utf-16) will not be read correctly, you’ll get garbage in the editor, and the compiler will emit strange errors.
If the file is output from perl using the :encoding(utf-16le) method, then the file is *still* corrupt. However, this time it’s Perl’s fault as it’s not written out the BOM to the file.
This last point is relatively easily worked-around in perl, but it’s still bad that it’s not standards compliant, just like Visual Studio isn’t.
Gah! We can’t win.