0

can special characters be used as a part of key?

For example :

{
    "+new":"addnew.png"
    "":"empty.png"
}

Is this format of rapidjson valid?

Also, is there any special strings that is not valid to use as key?

(I think the earlier question cannot fully answer my question because it does not cover the case of empty string, e.g.:"":"empty.png")

ggrr
  • 7,737
  • 5
  • 31
  • 53
  • possible duplicate of [Illegal characters in object or JSON key](http://stackoverflow.com/questions/8676011/illegal-characters-in-object-or-json-key) – Timothy Jul 07 '15 at 02:38

2 Answers2

0

Yes. Any valid string can be used as key. But the shown JSON misses a comma between two members.

Milo Yip
  • 4,902
  • 2
  • 25
  • 27
0

By http://www.json.org/:

A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes.

You can use JSONLint to validate the json string.

doqtor
  • 8,414
  • 2
  • 20
  • 36