#1528 ParameterTree::get() should not depend on the locale
Metadata
Property | Value |
---|---|
Reported by | Jö Fahlke (jorrit@jorrit.de) |
Reported at | Nov 7, 2014 13:15 |
Type | Bug Report |
Version | 2.3 |
Operating System | Unspecified / All |
Last edited by | Jö Fahlke (jorrit@jorrit.de) |
Last edited at | Nov 8, 2014 13:01 |
Closed by | Jö Fahlke (jorrit@jorrit.de) |
Closed at | Nov 8, 2014 13:01 |
Closed in version | Unknown |
Resolution | Fixed |
Comment |
Description
Stefan Rave discovered that the result of
ptree.get("setting")
for a config file
setting = 0.5
depends on the set locale: it is 0.5 in "C" but 0 in "de_DE". No diagnostics is issued, see #1527 (closed).
This only applies when setlocale() has been called with the environment variables set apropriately. This can happen implicitly when external libraries are loaded, or explicitly when the simulation program sets the locale to have a localized user interface.
IMO configuration files should not be locale-dependent, so the only solution is to always assume C locale when parsing numerical values in parametertree.