Skip to content
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

Errors parsing & writing JSON floats, in some locales #54

Closed
snej opened this issue Sep 23, 2019 · 0 comments · Fixed by #56
Closed

Errors parsing & writing JSON floats, in some locales #54

snej opened this issue Sep 23, 2019 · 0 comments · Fixed by #56
Assignees

Comments

@snej
Copy link
Contributor

snej commented Sep 23, 2019

The code we use for reading/writing floating point is (accidentally) locale-dependent, thanks to some really bad design decisions in the ANSI C and POSIX specs. This means that in locales that don't use "." as the decimal point character, floats won't parse or format properly. (Pointed out by @Dushistov in #51.)

@snej snej self-assigned this Sep 23, 2019
snej added a commit that referenced this issue Sep 23, 2019
* Reading/writing floating point was accidentally locale-dependent,
  which caused errors in locales that don't use '.' as the decimal
  point. (Fixes #54)
* Improved round-trip accuracy of Fleece->JSON->Fleece float/double
  conversions, by writing the optimal number of decimal places.
  To do this we brought in a small subcomponent of Swift. (Fixes #55)
snej added a commit that referenced this issue Sep 23, 2019
* Reading/writing floating point was accidentally locale-dependent,
  which caused errors in locales that don't use '.' as the decimal
  point. (Fixes #54)
* Improved round-trip accuracy of Fleece->JSON->Fleece float/double
  conversions, by writing the optimal number of decimal places.
  To do this we brought in a small subcomponent of Swift. (Fixes #55)
snej added a commit that referenced this issue Sep 24, 2019
* Reading/writing floating point was accidentally locale-dependent,
  which caused errors in locales that don't use '.' as the decimal
  point. (Fixes #54)
* Improved round-trip accuracy of Fleece->JSON->Fleece float/double
  conversions, by writing the optimal number of decimal places.
  To do this we brought in a small subcomponent of Swift. (Fixes #55)
snej added a commit that referenced this issue Sep 24, 2019
* Reading/writing floating point was accidentally locale-dependent,
  which caused errors in locales that don't use '.' as the decimal
  point. (Fixes #54)
* Improved round-trip accuracy of Fleece->JSON->Fleece float/double
  conversions, by writing the optimal number of decimal places.
  To do this we brought in a small subcomponent of Swift. (Fixes #55)
snej added a commit that referenced this issue Sep 24, 2019
* Reading/writing floating point was accidentally locale-dependent,
  which caused errors in locales that don't use '.' as the decimal
  point. (Fixes #54)
* Improved round-trip accuracy of Fleece->JSON->Fleece float/double
  conversions, by writing the optimal number of decimal places.
  To do this we brought in a small subcomponent of Swift. (Fixes #55)
snej added a commit that referenced this issue Sep 24, 2019
* Reading/writing floating point was accidentally locale-dependent,
  which caused errors in locales that don't use '.' as the decimal
  point. (Fixes #54)
* Improved round-trip accuracy of Fleece->JSON->Fleece float/double
  conversions, by writing the optimal number of decimal places.
  To do this we brought in a small subcomponent of Swift. (Fixes #55)
snej added a commit that referenced this issue Sep 24, 2019
* Reading/writing floating point was accidentally locale-dependent,
  which caused errors in locales that don't use '.' as the decimal
  point. (Fixes #54)
* Improved round-trip accuracy of Fleece->JSON->Fleece float/double
  conversions, by writing the optimal number of decimal places.
  To do this we brought in a small subcomponent of Swift. (Fixes #55)
@snej snej closed this as completed in #56 Sep 24, 2019
snej added a commit that referenced this issue Sep 24, 2019
* Reading/writing floating point was accidentally locale-dependent,
  which caused errors in locales that don't use '.' as the decimal
  point. (Fixes #54)
* Improved round-trip accuracy of Fleece->JSON->Fleece float/double
  conversions, by writing the optimal number of decimal places.
  To do this we brought in a small subcomponent of Swift. (Fixes #55)
* Added float-to-string conversion tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant