Escape and unescape JSON, JavaScript, HTML and URL strings
The result shows up hereJSON and JavaScript share the same backslash rules; JavaScript also escapes single quotes so the result drops into '…'. HTML only touches & < > " '. URL uses percent-encoding, where a space becomes %20.