Encode/decode URL's parameters Tag(s): WinAPI/Registry

Powerscript doesn't provide functions like Javascript's escape/unescape or Java's encode/decode.

The trick to use the Javascript engine from Powerscript.

OleObject wsh
Integer  li_rc
string ls_temp

wsh = CREATE OleObject
li_rc = wsh.ConnectToNewObject( "MSScriptControl.ScriptControl" )
wsh.language = "javascript"

ls_temp = wsh.Eval("escape('H e l l o')")

MessageBox( "ESCAPE" , ls_temp)

ls_temp = wsh.Eval("unescape('" + ls_temp + "')")

MessageBox( "UNESCAPE" , ls_temp)

blog comments powered by Disqus