Sample code for 30+ languages & platforms
PowerBuilder Requires Chilkat v11.1.0+

HTML Encoding

Demonstrates HTML encoding and decoding.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
oleobject loo_Crypt
string s
string ls_HtmlEncoded

loo_Crypt = create oleobject
li_rc = loo_Crypt.ConnectToNewObject("Chilkat.Crypt2")
if li_rc < 0 then
    destroy loo_Crypt
    MessageBox("Error","Connecting to COM object failed")
    return
end if

s = "< é ü ç Ω Hello & World ✓ >"

ls_HtmlEncoded = loo_Crypt.EncodeString(s,"utf-8","html")
Write-Debug ls_HtmlEncoded

//  Output:
//  < &eacute; &uuml; &ccedil; &ohm; Hello & World &check; >

//  To decode:
s = loo_Crypt.DecodeString(ls_HtmlEncoded,"utf-8","html")
Write-Debug s

//  Output:
//  < é ü ç Ω Hello & World ✓ >


destroy loo_Crypt