Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Floating Point Parser Behavior Is Locale Dependent #3270
Mruby's parse.y uses libc's strtod to parse floating point literals. For some locale configurations (those which use ',' in place of '.' as a decimal separator) this results in incorrectly parsed literals. Cruby appears to work around this with by using their own implementation, ruby_strtod which by default (unless USE_LOCALE is explicitly enabled) ignores locale settings when parsing ruby code.
A similar solution would be preferred here as setlocale cannot be safely used in applications where mruby is embedded within another program (e.g. for the case of plugins which make use of mruby).