I attempting to instantiate a std::locale
object with the US or GB-English locale string:
std::locale loc("en_US");
or
std::locale loc("en_GB");
Both of which throw a bad locale name runtime exception.
Creating a locale using ""
or "C"
works fine, however I'm having trouble setting an individual country locale.
The reason I'd like to do this is for unit testing purposes to make sure a collection of string sorting methods work correctly.
Note: I should also point out that I'm coding in Windows using Visual Studio 2008 (and I'd like to keep my code cross-platform if possible)