json stringify escape special characters
" resultados de la bsqueda relacionados16/03/2017 How FOR JSON escapes special characters and control characters (SQL Server) 03/16/2017 2 minutes to read Contributors. Now you should have an valid JSON string which you can parse again with JSON.parse(). Always escaping whenever you stringify a object to JSON is a good idea to keep you application working even when special characters are being provided. When the PHP code receives this, AJax has made further escapes to special characters, and also removed stringifys escape of the lf.var newMessToSend JSON.stringify(newMess) Jackson handles escaping of JSON String values in minimal way using escaping where absolutely necessary: it escapes two characters by default -- double quotes and backslash -- as well as non-visible control characters. But it does not escape other characters JSON.parse seems to error on any characters. Question 1: Does stringify not escape special characters like new lines and single quotes? Question 2: Shouldnt I expect that a JSON.stringifyed string generated without error would be parsed without error in var myJSONString JSON.stringify(myJSON) var myEscapedJSONString myJSONString.escapeSpecialCharsLike you, I have been looking into several comments and post to replace special escape characters in my JSON which contains html object inside that. I suppose my workaround is to use either a different JSON library, or manually escape strings myself after calling JSON.