Skip to content

Commit

Permalink
workaround for buggy setlocale() under AIX (without this wxLocale did…
Browse files Browse the repository at this point in the history
…n't work at all)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
  • Loading branch information
vadz committed Sep 18, 2005
1 parent c90c340 commit 420de41
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/common/intl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 420de41

Please sign in to comment.