These characters are :
- ‘ single quote
- ” quote
- \ backslash
- all control characters like \n \t
Lotus Notes Domino solution
If you are generating JSON in a Lotus Notes Domino view you can use the following command:
Unfortunately no library can be used in a Notes View. The solution above is only a quick win.
You may find Lotus Notes Script JSON library at json.org
The excellent jQuery plugin JSON Parser can help you to deal with JSON.
The method quoteString() is for sure the one you may need.
Other parsers can be found at json.org
to escape a ” you should write \”
to escape a you should write \\
If you are working in a Domino view you will have to write something like \\\\, it’s not very readable.
With the HTML character code you don’t have to worry anymore about how many \ you have to add.
' or " replace ‘
\ replace \
" replace ”
With ' you save one more character compare to its equivalent "
In a JSON with a lot of data it’s always good to optimize the size.