Encode/Decode to URL-encoded In PowerBuilder Using Javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | OleObject wsh Integer li_rc String ls_encode, ls_decode wsh = Create OleObject li_rc = wsh.ConnectToNewObject( "MSScriptControl.ScriptControl" ) wsh.language = "javascript" ls_encode = wsh.Eval("encodeURIComponent('藥品報價單')") //%E8%97%A5%E5%93%81%E5%A0%B1%E5%83%B9%E5%96%AE ls_decode = wsh.Eval("decodeURIComponent('"+ls_encode+"')") wsh.DisconnectObject() Destroy wsh MessageBox( "Encode" , ls_encode) MessageBox( "Decode" , ls_decode) |
Good Luck!