Recently did the project, appeared the problem of Chinese garbled, specially study.
GB2312, refers to the Chinese
UTF8, refers to the national standard, including Chinese, English.
However, by the Jquery.ajax get, Post, if you pass the Chinese or special characters of the envoy character, this time will appear garbled.
JS code encodeURI: For URLs, not escaped/&
encodeURIComponent: For parameters, Escape/&, if parameters have/& these symbols, use this.
JS decoding decodeURI: For URLs, not escaped/&
decodeURIComponent: For parameters, Escape/&, if parameters have/& these symbols, use this.
C # encoding uri.escapeuristring for URLs, not escaped/&
Uri.escapedatastring for parameters, Escape/& if parameters have/& these symbols, use this.
C # decoding Httputility.urldecode (string s)
Chat front-end encoding and decoding, C # encoding and decoding.