JSON special character processing

Source: Internet
Author: User
Tags key string

Identifiers used in 1.json structures: all in English format

Colon:double quote ""curly Braces {}square brackets []comma, 2. Use noteBe sure to use the above standard identifier to construct the structure in the JSON structure. The string of keys is enclosed in double quotation marks, and cannot contain double quotes and escape characters in the key string. There are four other identifiers in the key string that can appear in addition to the double quotation marks, without error.  3. The escape character to be processed\a Bell (BEL)\b Backspace (BS)\e Scientific Counting method\f page Break (FF)\ n line Break (LF)\ r Enter (CR)\ t Horizontal tabulation (HT)\v Vertical tabulation (VT)\ \ counter Slash\ "Double quote characterA /s null character (NULL) 4. Solutionon the server side, the carriage return line in the string is replaced with a string similar to <br/>, and the double quotes are the same, such as <dqmv/>The client, before parsing, deletes all escaped characters. after parsing, returns the carriage return and double quotation marks before displaying the content. or the conversion work is put on the front end to do, because the back end of the Constoller to turn the place is not good to do. there are methods in Fastjson, JSON. tojsonstring (
Object Object,
Serializerfeature.
Browsercompatible

JSON special character processing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.