Hello,
I have read quite a lot of threads and documentation about wxLocale, but it remains a subject that still remains unclear.
So here is what i want to do: some of my threads including the main gui thread need to use the current locale (to use the proper decimal separator). Solution: create a wxLocale member in the APP, call Init and you are done!
But: some of my threads that generate XML need to used the "C' locale and not the 'APP' one.
Question: how do I do it using wxWidgets.
C: code _configthreadlocale(_ENABLE_PER_THREAD_LOCALE), set current locale and done.
How is this done with wxLocale? Can you specify to wxString::Printf() which locale to use? Can you do a per thread setting?
Thanks for any support,
Johi.
wxLocale equivalent of _configthreadlocale(_ENABLE_PER_THREAD_LOCALE)
Re: wxLocale equivalent of _configthreadlocale(_ENABLE_PER_THREAD_LOCALE)
Under Windows ::SetThreadLocale() is called to set the locale, so creating another wxLocale instance in the thread should work. But for the other platforms, i don't see any equivalent code in <wxdir>/src/common/intl.cpp
If it's only for number conversions, there are a few helper functions in wxString that might help, e.g.
wxString::ToCDouble
https://docs.wxwidgets.org/trunk/classw ... 74f1f2b733
wxString::FromCDouble
https://docs.wxwidgets.org/trunk/classw ... 79dcaa2add
If it's only for number conversions, there are a few helper functions in wxString that might help, e.g.
wxString::ToCDouble
https://docs.wxwidgets.org/trunk/classw ... 74f1f2b733
wxString::FromCDouble
https://docs.wxwidgets.org/trunk/classw ... 79dcaa2add
Use the source, Luke!
Re: wxLocale equivalent of _configthreadlocale(_ENABLE_PER_THREAD_LOCALE)
Thank you very much for the info.
I created a local wxLocale object to do what needs to be done and it worked properly.
Best Regards,
Johi.
I created a local wxLocale object to do what needs to be done and it worked properly.
Best Regards,
Johi.