-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Description
I like very much the JSON.jl
package and use all the time for serializing/deserializing Julia object in human-readable format.
When writing Measurements
object, it literarily prints ±
, that makes JSON invalid. It cannot be read.
using Measurements
using JSON
begin
open("test.json", "w") do io
JSON.print(io, Dict("value" => 1.1 ± 3.3))
end
#
open("test.json") do io
JSON.parse(io)
end
end
throws,
Expected ',' here
...when parsing byte with value '194'
This using strings works correctly,
begin
open("test.json", "w") do io
JSON.print(io, Dict("value" => "1.1 ± 3.3"))
end
#
open("test.json") do io
JSON.parse(io)
end
end
Suggestion
Treat Measurements similar to complex numbers, writing val
, and err
field in Dict.
Metadata
Metadata
Assignees
Labels
No labels