if setlocale doesn't work, try again with en_US -- works around

problem on my ISP.
This commit is contained in:
ehouse 2009-01-28 03:32:21 +00:00
parent a61e355b85
commit d46152b5f6

View file

@ -154,6 +154,7 @@ main( int argc, char** argv )
exit(1);
}
try_english:
char buf[32];
const char* locale = "";
if ( !!gLang && !!gEncoding ) {
@ -162,6 +163,14 @@ main( int argc, char** argv )
}
char* oldloc = setlocale( LC_ALL, locale );
if ( !oldloc ) {
// special case for spiritone.net, where non-US locale files aren't
// available. Since utf-8 is the same for all locales, we can get by
// with en_US instead
if ( gIsMultibyte && 0 != strcmp( gLang, "en_US" )) {
gLang = "en_US";
goto try_english;
}
ERROR_EXIT( "setlocale(%s) failed, error: %s", locale,
strerror(errno) );
} else {