From 420de418ea2edb0eec0704671f9eb219298c06b7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 18 Sep 2005 23:38:06 +0000 Subject: [PATCH] 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 --- src/common/intl.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 8d462de22c..d47dbea5b1 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -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 -- 2.45.2