workaround for buggy setlocale() under AIX (without this wxLocale didn't work at all)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-09-18 23:38:06 +00:00
parent c90c34007a
commit 420de418ea

View File

@@ -1600,6 +1600,18 @@ bool wxLocale::Init(int language, int flags)
wxMB2WXbuf retloc = wxSetlocaleTryUTF(LC_ALL, locale);
#ifdef __AIX__
// at least in AIX 5.2 libc is buggy and the string returned from setlocale(LC_ALL)
// can't be passed back to it because it returns 6 strings (one for each locale
// category), i.e. for C locale we get back "C C C C C C"
//
// this contradicts IBM own docs but this is not of much help, so just work around
// it in the crudest possible manner
wxChar *p = wxStrchr((wxChar *)retloc, _T(' '));
if ( p )
*p = _T('\0');
#endif // __AIX__
if ( !retloc )
{
// Some C libraries don't like xx_YY form and require xx only