]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/intl.cpp
Remove temporary files created by wxFileName unit test case.
[wxWidgets.git] / src / common / intl.cpp
index 9b38ffbf14e52ff2f7e5ce8e5896267e18988700..97cb520a397b9eec5f633b859419c6512d36672f 100644 (file)
@@ -1442,7 +1442,23 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat)
                                      : LOCALE_SDECIMAL,
                                  buf,
                                  WXSIZEOF(buf)) )
+            {
                 str = buf;
+
+                // As we get our decimal point separator from Win32 and not the
+                // CRT there is a possibility of mismatch between them and this
+                // can easily happen if the user code called setlocale()
+                // instead of using wxLocale to change the locale. And this can
+                // result in very strange bugs elsewhere in the code as the
+                // assumptions that formatted strings do use the decimal
+                // separator actually fail, so check for it here.
+                wxASSERT_MSG
+                (
+                    wxString::Format("%.3f", 1.23).find(str) != wxString::npos,
+                    "Decimal separator mismatch -- did you use setlocale()?"
+                    "If so, use wxLocale to change the locale instead."
+                );
+            }
             break;
 
         case wxLOCALE_SHORT_DATE_FMT: