use setlocale() instead of getenv() for determining locale

This commit is contained in:
Andrzej Rybczak
2009-01-12 08:35:02 +01:00
parent daca5964e8
commit 11b18b95e5

View File

@@ -90,7 +90,7 @@ namespace
void init_current_locale() void init_current_locale()
{ {
std::string envlocale = getenv("LC_CTYPE") ? getenv("LC_CTYPE") : (getenv("LC_ALL") ? getenv("LC_ALL") : ""); std::string envlocale = setlocale(LC_CTYPE, "");
if (envlocale.empty()) if (envlocale.empty())
return; return;
std::ifstream f(SUPPORTED_LOCALES); std::ifstream f(SUPPORTED_LOCALES);