MyChat Scripts Engine: DecodeURL
Function to decode a string from URL format to plain text.
Syntax
function DecodeURL(sURL: string): string;
Parameters and return values
Parameter |
Type |
Value |
sURL |
string |
source string. |
Function result
Returns decoded URL address string.
Example
const
sUrl = 'https://companysite.com/?data_query#21';
var
s: string;
begin
mLogScript('URL: ' + sURL, '');
s := EncodeURL(sUrl);
mLogScript(s, 'EncodeURL');
mLogScript(DecodeURL(s), 'DecodeURL');
end.
Script work result
[23:40:47] (Log "DecodeURL"): URL: https://companysite.com/?data_query#21
[23:40:47] (Log "DecodeURL"): [EncodeURL] https://companysite.com/?%E7%E0%EF%F0%EE%F1_%E4%E0%ED%ED%FB%F5#21
[23:40:47] (Log "DecodeURL"): [DecodeURL] https://companysite.com/?data-query#21
[23:40:47] (Run "DecodeURL"): Script operation time: 7 ms
[23:40:47] (Run "DecodeURL"): Script done successfully.