mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-11 08:48:06 +01:00
if setlocale doesn't work, try again with en_US -- works around
problem on my ISP.
This commit is contained in:
parent
a61e355b85
commit
d46152b5f6
1 changed files with 9 additions and 0 deletions
|
@ -154,6 +154,7 @@ main( int argc, char** argv )
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try_english:
|
||||||
char buf[32];
|
char buf[32];
|
||||||
const char* locale = "";
|
const char* locale = "";
|
||||||
if ( !!gLang && !!gEncoding ) {
|
if ( !!gLang && !!gEncoding ) {
|
||||||
|
@ -162,6 +163,14 @@ main( int argc, char** argv )
|
||||||
}
|
}
|
||||||
char* oldloc = setlocale( LC_ALL, locale );
|
char* oldloc = setlocale( LC_ALL, locale );
|
||||||
if ( !oldloc ) {
|
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,
|
ERROR_EXIT( "setlocale(%s) failed, error: %s", locale,
|
||||||
strerror(errno) );
|
strerror(errno) );
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue