Func _encodeURIComponent($sTxt)
$sTxt = StringReplace($sTxt, Chr(0), '')
$sTxt = StringReplace($sTxt, @CRLF, '\r\n')
$sTxt = StringReplace($sTxt, @CR, '\r')
$sTxt = StringReplace($sTxt, @LF, '\n')
$sTxt = StringRegExpReplace($sTxt, "\s", " ")
$sTxt = StringReplace($sTxt, "'", "\'")
$sTxt = StringReplace($sTxt, '"', '\"')
$oSC = ObjCreate("ScriptControl")
If Not IsObj($oSC) Then Return SetError(1)
$oSC.Language = "JavaScript"
Return $oSC.Eval('encodeURIComponent("' & $sTxt & '");')
EndFunc ;==>_encodeURIComponent
Func _decodeURIComponent($sTxt)
$sTxt = StringReplace($sTxt, Chr(0), '')
$sTxt = StringReplace($sTxt, @CRLF, '\r\n')
$sTxt = StringReplace($sTxt, @CR, '\r')
$sTxt = StringReplace($sTxt, @LF, '\n')
$sTxt = StringRegExpReplace($sTxt, "\s", " ")
$sTxt = StringReplace($sTxt, "'", "\'")
$sTxt = StringReplace($sTxt, '"', '\"')
$oSC = ObjCreate("ScriptControl")
If Not IsObj($oSC) Then Return SetError(1)
$oSC.Language = "JavaScript"
Return $oSC.Eval('decodeURIComponent("' & $sTxt & '");')
EndFunc ;==>_encodeURIComponent
Local $orig_url = 'http://autoit-script.ru/index.php?topic=27093.new#new'
Local $encoded_url = _encodeURIComponent($orig_url)
Local $decoded_url = _decodeURIComponent($encoded_url)
ConsoleWrite($orig_url & @CRLF & $encoded_url & @CRLF & $decoded_url & @CRLF)