New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
string_of_float and float_of_string are locale dependent #6701
Comments
Comment author: @damiendoligez If at all possible, we should make these functions locale-independent and (maybe) provide some explicitly locale-dependent functions. |
Comment author: @hhugo cross reference mirage/mirage-platform#118 |
Comment author: @xavierleroy I'm postponing this PR to 'later', as there is no simple solution. For reference, here are some options:
|
Comment author: @xavierleroy Contradicting myself: strtod_l is indeed available in Linux/Glibc, it's just that it has no man page on my Linux installation. Perhaps it could be used, as a best effort. |
Comment author: markghayden Is there any progress on this? We have a German user on Ubuntu with issue because Yojson rejects valid JSON file because of locale issue converting strings to floats. |
Comment author: @ygrek strtod_l will work, but afaics in 2017 there is no obvious solution for linux to printf floats in locale-independent way.. Options:
|
Comment author: @hhugo Thanks to all of you for the fix. |
Original bug ID: 6701
Reporter: @hhugo
Assigned to: @gasche
Status: resolved (set by @gasche on 2018-06-01T19:51:51Z)
Resolution: fixed
Priority: normal
Severity: minor
Target version: later
Fixed in version: 4.08.0+dev/beta1/beta2
Category: standard library
Related to: #6296
Monitored by: braibant @hhugo @gasche @ygrek Bardou @hcarty @dbuenzli
Bug description
archive from 2004, http://caml.inria.fr/pub/ml-archives/caml-list/2004/06/e8eba13a4e7977d4c49f83bb9ea0eff2.en.html
Additional information
for example, Yojson will be unable to read/parse JSON containing floats.
ocaml-community/yojson#13
The text was updated successfully, but these errors were encountered: