C
chris.d.williams
I am trying to use std::locale with g++ 3.4.2 on Solaris 10 and I can't
set any locale other than C or POSIX. I get the following exception
everytime, Error for en_US: locale::facet::_S_create_c_locale name not
valid. Here is what my program looks like. Anyone else having this
problem or any idea why this is happening? When run the locale -a
command, I see a whole list of locales installed on the system other
that C and POSIX.
Thanks
CW
#include <iostream>
#include <locale>
using namespace std;
int main(int argc, char **argv) {
for (int ii = 1; ii < argc; ++ii) {
try {
locale loc(argv[ii]);
cout << "Created locale " << loc.name() << endl;
}
catch (exception & e) {
cout << "Error for " << argv[ii] << ": " << e.what() << endl;
}
}
return 0;
}
set any locale other than C or POSIX. I get the following exception
everytime, Error for en_US: locale::facet::_S_create_c_locale name not
valid. Here is what my program looks like. Anyone else having this
problem or any idea why this is happening? When run the locale -a
command, I see a whole list of locales installed on the system other
that C and POSIX.
Thanks
CW
#include <iostream>
#include <locale>
using namespace std;
int main(int argc, char **argv) {
for (int ii = 1; ii < argc; ++ii) {
try {
locale loc(argv[ii]);
cout << "Created locale " << loc.name() << endl;
}
catch (exception & e) {
cout << "Error for " << argv[ii] << ": " << e.what() << endl;
}
}
return 0;
}