1

Gson serializes {"test": "abc\ndef"} to {"test": "abc\ndef"}. According to this discussion, and my understanding of JSON standard, it is not a valid JSON. It needs to be {"test": "abc\\ndef"}. I.e the "\n" needs to be converted to \\n.

Is my understanding correct?

Community
  • 1
  • 1
RDK
  • 923
  • 1
  • 9
  • 22

0 Answers0