]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/intl.cpp
Shell version of dllar, needed for building DLLs while generating
[wxWidgets.git] / src / common / intl.cpp
index ecb0166cff09e58f6ddc9e500bf39985f9cb0c8c..49a022525d0e04f9685d430e4287adb4e3b43ce0 100644 (file)
     #pragma option -O1
 #endif
 
     #pragma option -O1
 #endif
 
+#ifdef __EMX__
+// The following define is needed by Innotek's libc to
+// make the definition of struct localeconv available.
+#define __INTERNAL_DEFS
+#endif
+
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -1418,9 +1424,11 @@ bool wxLocale::Init(const wxChar *szName,
   // TODO: how to find languageId
   // SetLocaleInfo(languageId, SORT_DEFAULT, localeName);
 #else
   // TODO: how to find languageId
   // SetLocaleInfo(languageId, SORT_DEFAULT, localeName);
 #else
-  m_pszOldLocale = wxSetlocale(LC_ALL, szLocale);
-  if ( m_pszOldLocale )
-      m_pszOldLocale = wxStrdup(m_pszOldLocale);
+  wxMB2WXbuf oldLocale = wxSetlocale(LC_ALL, szLocale);
+  if ( oldLocale )
+      m_pszOldLocale = wxStrdup(oldLocale);
+  else
+      m_pszOldLocale = NULL;
 #endif
 
   if ( m_pszOldLocale == NULL )
 #endif
 
   if ( m_pszOldLocale == NULL )
@@ -2510,7 +2518,7 @@ bool wxLocale::AddCatalog(const wxChar *szDomain)
 #ifdef __WXMSW__
 
 /* static */
 #ifdef __WXMSW__
 
 /* static */
-wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat)
+wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat))
 {
     wxString str;
     wxChar buffer[256];
 {
     wxString str;
     wxChar buffer[256];
@@ -2559,9 +2567,11 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat)
             switch (index)
             {
                 case wxLOCALE_THOUSANDS_SEP:
             switch (index)
             {
                 case wxLOCALE_THOUSANDS_SEP:
-                    return locale_info->thousands_sep;
+                    return wxString(locale_info->thousands_sep,
+                                    *wxConvCurrent);
                 case wxLOCALE_DECIMAL_POINT:
                 case wxLOCALE_DECIMAL_POINT:
-                    return locale_info->decimal_point;
+                    return wxString(locale_info->decimal_point,
+                                    *wxConvCurrent);
                 default:
                     return wxEmptyString;
             }
                 default:
                     return wxEmptyString;
             }
@@ -2569,9 +2579,11 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat)
             switch (index)
             {
                 case wxLOCALE_THOUSANDS_SEP:
             switch (index)
             {
                 case wxLOCALE_THOUSANDS_SEP:
-                    return locale_info->mon_thousands_sep;
+                    return wxString(locale_info->mon_thousands_sep,
+                                    *wxConvCurrent);
                 case wxLOCALE_DECIMAL_POINT:
                 case wxLOCALE_DECIMAL_POINT:
-                    return locale_info->mon_decimal_point;
+                    return wxString(locale_info->mon_decimal_point,
+                                    *wxConvCurrent);
                 default:
                     return wxEmptyString;
             }
                 default:
                     return wxEmptyString;
             }