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

Infinities and NaNs get encoded as invalid JSON #42

Open
snej opened this issue Feb 27, 2019 · 0 comments
Open

Infinities and NaNs get encoded as invalid JSON #42

snej opened this issue Feb 27, 2019 · 0 comments

Comments

@snej
Copy link
Contributor

snej commented Feb 27, 2019

A Fleece value can legitimately be a floating-point infinity or NaN, since it just stores a binary IEEE format float/double.

However, there's no JSON encoding of such a value. Currently Fleece just uses sprintf, which writes something like Inf or NaN ... resulting in invalid JSON.

Instead, the best behavior is probably to fail (throw an exception / return an error) when encoding such a value.

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

No branches or pull requests

1 participant