opencv2 setlocale clashes with wxLocale
Posted: Fri Dec 06, 2019 3:51 pm
Hi,
I started using opencv2 and it uses for the float decimal point. Now I myself use wxLocale for the language of my program resulting in:
I started using opencv2 and it uses
Code: Select all
setlocale(LC_NUMERIC,"C");
so what can I do? I can hardly make opencv use wxLocale, can I? Just remove setlocale and hope for the best?// 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."
);