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

Portable encoding of NaN and infinity to JSON #61

Closed
ecorm opened this issue May 8, 2015 · 0 comments
Closed

Portable encoding of NaN and infinity to JSON #61

ecorm opened this issue May 8, 2015 · 0 comments
Labels
Milestone

Comments

@ecorm
Copy link
Owner

ecorm commented May 8, 2015

wamp::Json::encode currently relies on std::snprintf to encode numbers to JSON. If NaN or +/-Infinity is passed to the encoder, it will be serialized as nan and inf/infinity, according to the fprintf documentation.

Unfortunately, JSON does not support encoding of these special values, as raised in this SO question.

wamp::Json::encode should therefore recognize these special values, and encode them as null.

@ecorm ecorm added the bug label May 8, 2015
@ecorm ecorm added this to the v0.3.1 milestone May 8, 2015
@ecorm ecorm closed this as completed in 74dfe5c May 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant