wxString::FromCDouble is locale dependent Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
PeterO
Earned a small fee
Earned a small fee
Posts: 14
Joined: Mon Jun 23, 2014 11:12 am

wxString::FromCDouble is locale dependent

Post by PeterO »

Hello there.

On initializing my application I want to set the global locale to the system locale by calling wxLocale.Init();
But wxLocale.Init() only sets the C global locale to the system locale.
To set the C++ global locale as well I call: std::locale::global(std::locale(setlocale(LC_ALL, NULL)));
However when I use wxString::FromCDouble it now returns the format according to the system locale.
There's now difference anymore between wxString::FromDouble and wxString::FromCDouble.
It seems that FromCDouble is locale dependent.
Is this is a bug?

Regards,
Peter
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxString::FromCDouble is locale dependent

Post by doublemax »

I haven't tried this myself, but if you can reproduce it with a small patch to the "minimal" sample, please open a bug report at http://trac.wxwidgets.org/
Use the source, Luke!
PeterO
Earned a small fee
Earned a small fee
Posts: 14
Joined: Mon Jun 23, 2014 11:12 am

Re: wxString::FromCDouble is locale dependent

Post by PeterO »

Ok, I've made a new ticket: #16343
PeterO
Earned a small fee
Earned a small fee
Posts: 14
Joined: Mon Jun 23, 2014 11:12 am

Re: wxString::FromCDouble is locale dependent

Post by PeterO »

Ticket #16343 has been fixed.
Post Reply