I'm trying to learn different locales and handling unicode and I chose to make all my strings UTF-8 and I decided to run the following code but for some reason it throws an error and I cannot figure out why.. I tried every locale so far and none except "C" works.. I tried the list of locales found here: http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html
and their example:
#include <iostream>
#include <string>
int main()
{
std::locale::global(std::locale("en_US.UTF-8"));
return 0;
}
Results in:
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
What am I doing wrong?
I'm using Mingw-Builds gcc/g++ 4.8.1 with the latest codeblocks on Windows 8. Language is set to EN_US and sometimes I switch to EN_GB.