When the query string is used in the url, the square question is translated and some related information is checked. Basically, the server that uses js is used. encode (); server. decode (); Use the url for sending and receiving respectively.
However, you may encounter curl sending and html receiving problems. So I want to translate all the parameter strings into unicode codes on the curl side and parse them through js on the html page.
The specific method is as follows:
Write the following function on the curl side to convert the string to a decimal unicode code and identify it:
{Method private {encodestrtounicode STR: string}: String
Let result: String = ""
{For I: Int = 0 below Str. Size do
Let Baz: Char = {Str. Get I}
Set result = Result & ":" & {format "% d", Baz}
}
{Return result}
}
The parsing code is as follows:
Function unicode2ostr (STR )...{
VaR Re =/: [Da-fa-F]... {1, 5}/ig;
VaR arr = Str. Match (re );
If (arr = null) return ("");
For (var I = 0; I <arr. length; I ++ )...{
Arr [I] = String. fromCharCode (arr [I]. replace (/:/g ,""));
}
Return (arr. toString (). replace (/,/g ,""))
}