json parse: special characters
Bug #866757 reported by
Dennis Knochenwefel
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
Medium
|
Dennis Knochenwefel |
Bug Description
for some special characters (formfeed, carriage return and backspace), json:parse returns some strange entities:
import module namespace json = "http://
declare variable $local:json :=
'{ "special-chars": {
"unicode": "\u007B",
"quote": "\"",
"newline": "\n",
"carriage return": "\r",
"solidus": "\/"
}
}';
json:parse(
To post a comment you must log in.
I think, that the parse part is even correct (the strange entities come from the xml serialization). But it's still a problem because this query returns false:
import module namespace json = "http:// www.zorba- xquery. com/modules/ json";
declare variable $local:json :=
"backslash" : "\\",
"backspace" : "\b",
"formfeed" : "\f",
"horizontal tab": "\t",
'{ "special-chars": {
"unicode": "\u007B",
"quote": "\"",
"newline": "\n",
"carriage return": "\r",
"solidus": "\/"
}
}';
json:serialize( json:parse( $local: json)) eq $local:json