PowerBuilder
PowerBuilder
Example: Crypt2.DecodeString method
Demonstrates how to call the DecodeString method.Chilkat PowerBuilder Downloads
integer li_rc
oleobject loo_Crypt2
string ls_EncodedStr
string ls_Encoding
string ls_Charset
string ls_Str
loo_Crypt2 = create oleobject
li_rc = loo_Crypt2.ConnectToNewObject("Chilkat.Crypt2")
if li_rc < 0 then
destroy loo_Crypt2
MessageBox("Error","Connecting to COM object failed")
return
end if
// The string "Hello World" in base64 (using the utf-8 byte representation) is "SGVsbG8gV29ybGQ="
ls_EncodedStr = "SGVsbG8gV29ybGQ="
ls_Encoding = "base64"
ls_Charset = "utf-8"
ls_Str = loo_Crypt2.DecodeString(ls_EncodedStr,ls_Charset,ls_Encoding)
Write-Debug ls_Str
// Output is "Hello World"
destroy loo_Crypt2