new revision: 1.381; previous revision: 1.380
done
+24. Fix wxLocale::Init to try xx_YY.utf8 on systems where xx_YY fails
+(presumably RedHat; do it in Unicode mode only)
+
+See: Patch [ 766893 ]
+Checking in intl.cpp;
+/pack/cvsroots/wxwindows/wxWindows/src/common/intl.cpp,v <-- intl.cpp
+new revision: 1.97; previous revision: 1.96
+done
+Checking in changes.txt;
+/pack/cvsroots/wxwindows/wxWindows/docs/changes.txt,v <-- changes.txt
+new revision: 1.297; previous revision: 1.296
+done
+
TODO for 2.4 (items that are not backports)
===========================================
#endif // __UNIX__
+
// ----------------------------------------------------------------------------
// wxMsgCatalogFile corresponds to one disk-file message catalog.
//
return bOk;
}
+
+#if defined(__UNIX__) && wxUSE_UNICODE
+static wxWCharBuffer wxSetlocaleTryUTF(int c, const wxChar *lc)
+{
+ wxMB2WXbuf l = wxSetlocale(c, lc);
+ if ( lc && lc[0] != 0 && !l )
+ {
+ wxString buf(lc);
+ buf += wxT(".utf8");
+ l = wxSetlocale(c, buf.c_str());
+ }
+ return l;
+}
+#else
+#define wxSetlocaleTryUTF(c, lc) wxSetlocale(c, lc)
+#endif
+
bool wxLocale::Init(int language, int flags)
{
int lang = language;
else
locale = info->CanonicalName;
- wxMB2WXbuf retloc = wxSetlocale(LC_ALL, locale);
+ wxMB2WXbuf retloc = wxSetlocaleTryUTF(LC_ALL, locale);
if ( !retloc )
{
// Some C libraries don't like xx_YY form and require xx only
- retloc = wxSetlocale(LC_ALL, locale.Mid(0,2));
+ retloc = wxSetlocaleTryUTF(LC_ALL, locale.Mid(0,2));
}
if ( !retloc )
{
else if (mid == wxT("nn"))
locale = wxT("no_NY");
- retloc = wxSetlocale(LC_ALL, locale);
+ retloc = wxSetlocaleTryUTF(LC_ALL, locale);
}
if ( !retloc )
{
// (This time, we changed locale in previous if-branch, so try again.)
// Some C libraries don't like xx_YY form and require xx only
- retloc = wxSetlocale(LC_ALL, locale.Mid(0,2));
+ retloc = wxSetlocaleTryUTF(LC_ALL, locale.Mid(0,2));
}
if ( !retloc )
{