codecvt_byname not working on Linux gcc
gcc 7.1 with C11 linux
Code:
fin.imbue(std::locale(fin.getloc(),
new std::codecvt_byname<wchar_t, char, std::mbstate_t>("zh_CN.gb18030")));
produces:
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
Aborted (core dumped)
The code has been taken from:
http://en.cppreference.com/w/cpp/locale/codecvt_byname
I have tried as well with with en_US.UTF-8, but the result is the same.
What is the problem? gcc dies not support localization library?
Where to find valid list of locale names?
Re: codecvt_byname not working on Linux gcc
See https://stackoverflow.com/questions/...-names-windows for code that displays all the valid available locale names.
Also, from a console
locale -a
should also display the available names.