Instead of including locale and all that fancy stuff, if you know for FACT your string is convertible just do this:
#include
#include
using namespace std;
int main()
{
wstring w(L"bla");
string result;
for(char x : w)
result += x;
cout << result << '\n';
}
Live example here