The problem even if the source is UTF-8 with BOM "שלום" would
be encoded according to locale's 8bit codepage like 1255 or 936
and not UTF-8 string (codepage 65001).
It is rather stupid, but this is how MSVC works or understands
the place of UTF-8 in this world.
Unicode and Visual Studio is just broken...
Give us all a favor and cease developing locale library. It's not only useless, but also harmful. It encourage people to use ASCII.