Use C locale for numbers in wx(File)Config.
Using the current locale decimal point in config files results in problems when moving the files to another machine or even using a different locale on the same one, so don't do it. Always write the numbers using C locale and try to read them in C locale too first, but also try the current locale if we failed for backwards compatibility and to be tolerant with users who edit their config files by hand. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -689,6 +689,14 @@ public:
|
||||
/**
|
||||
Writes the double value to the config file and returns @true on
|
||||
success.
|
||||
|
||||
Notice that if floating point numbers are saved as strings (as is the
|
||||
case with the configuration files used by wxFileConfig), this function
|
||||
uses the C locale for writing out the number, i.e. it will always use a
|
||||
period as the decimal separator, irrespectively of the current locale.
|
||||
This behaviour is new since wxWidgets 2.9.1 as the current locale was
|
||||
used before, but the change should be transparent because both C and
|
||||
current locales are tried when reading the numbers back.
|
||||
*/
|
||||
bool Write(const wxString& key, double value);
|
||||
/**
|
||||
|
Reference in New Issue
Block a user