There are two distinct things that should cooperate.
1. The way the source code is written: make shure your editor saved the CPP files with UTF-8 encoding and not as an SBCS or MBCS codepage, otherwise the compiler sees the literal strings differently on what you expect.
2.
cout
and
wcout
use the C++ global
std:locale
facets to perform their task. They are not necessarily synchronized with the C locales.
The proper way is instantiate a C++ local class, and imbue it in the streams, like
#include <locale>
#include <iostreams>
int main()
{
std::locale loc("be_BY.utf8");
std::cout.imbue(loc);
std::wcout.imbue(loc);
}
This[
^] may also be helpful.