X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd1c361c33b5fc259d9c62e7c816e753cc1b1dd3..08670ea85abf4b4946a9ce64971b591d7b1ee30b:/src/common/intl.cpp?ds=sidebyside diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 9b38ffbf14..97cb520a39 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -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: