Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Escaping special characters in JSON / list of invalid characters to strip from JSON string

A JSON string must be double-quoted, according to the specs, so you don't need to escape '.
If you have to use special character in your JSON string, you can escape it using  character.

See this list of special character used in JSON :

  Backspace (ascii code 08)
f  Form feed (ascii code 0C)

  New line

  Carriage return
	  Tab
"  Double quote
  Backslash character

For new readers, always use a double quotes for your json strings.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Escaping #special #characters #JSON #list #invalid #characters #strip #JSON #string
ADD COMMENT
Topic
Name
5+3 =