Closed
Description
- json encodes math.Inf and math.Nan (which is against json specification)
- it fails to decode it
- it isn't compatible with standard
encoding/json
which raises error - it isn't compatible with json standard (https://www.json.org http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf)
Quote:
Numeric values that cannot be represented as sequences of digits (such as Infinity and NaN) are not permitted
this piece of code does not work:
func main() {
encVal := math.Inf(1)
s, e := jsoniter.MarshalToString(encVal)
log.Println(s, e)
var dec float64
err := jsoniter.UnmarshalFromString(s, &dec)
log.Print(err)
}
Metadata
Metadata
Assignees
Labels
No labels