As I understand c++11 allow easy to use conversion between string and wstring through wstring_convert, and it should be as easy as(incudes are omitted):
int main() {
std::wstring_convert< std::codecvt_utf8<wchar_t> > converter;
std::string gg = u8"prova";
std::wcout << converter.from_bytes(gg.data()) << std::endl;
}
The output is a null string.
I also tried std::codecvt_utf8_utf16 with no luck.
I looked up in stackoverflow and tried many suggestion such as C++ Convert string (or char*) to wstring (or wchar_t*) but nothing appens.
Can anyone help me here?
I'm on windows and I'm using gcc (g++) v 5.3.0 through mingw and msys2.
EDIT: Compiling the same code with Microsoft Visual Studio 2013 results in a working solution.