In the online version (including version 12.2, 12.3), the reference filter conditions in the transmission process through the URL encoding and decoding process, the use of the front and back of the API differences caused some problems, is now recorded as follows:
Front-end URL encoding API
encodeURIComponent URL encoding of strings using the UTF-8 encoding format;
Backend URL Decoding API: The following three decoding methods are present in the code:
System.Web.UI.Server.UrlDecode, there is a problem: Cannot parse%2b to +, output is white space character;
Microsoft.JScript.GlobalObject.unescape, there is a problem: can only use Unicode encoding format, and the front-end API used by the UTF-8 encoding format does not match, the specific problem is that Chinese characters can not be decoded correctly;
System.Web.HttpUtility.UrlDecode, there is a problem: You can specify the encoding format, easy to match the UTF-8 encoding format used by the front-end API, but the decoding of%2B is a non-idempotent, the first decoding can be correctly resolved to +, and the + Decoding will output white space characters;
In view of the above problems, in the service-side decoding process, it is necessary to carefully consider the various scenarios (including front-end, domain) of the codec, the number of times (inclusion BASE64 encoding) and other factors to decode.
Problems encountered during URL codec of front-end transfer string in actual project