How to write Unicode string to file with UTF-8 BOM by C++?
<p>I can use ofstream to write to UTF-8 BOM file. I can also write Unicode string to file using wofstream and imbue with <code>utf8_locale</code> (<code>codecvt_utf8</code>). However, I cannot find out how to write Unicode string to file with UTF-8 BOM encoding.</p>