Lua Requires Chilkat v11.1.0+
Lua
HTML Entity Encode and Decode in StringBuilder
Demonstrates HTML encoding and decoding the contents of a StringBuilder.Chilkat Lua Downloads
local chilkat = require("chilkat")
local sb = chilkat.StringBuilder.new()
local s = "< é ü ç Ω Hello & World ✓ >"
sb:append(s)
sb:encode("html", "utf-8")
print(sb:get_as_string())
-- Output:
-- < é ü ç Ω Hello & World ✓ >
-- To decode:
sb:decode("html", "utf-8")
print(sb:get_as_string())
-- Output:
-- < é ü ç Ω Hello & World ✓ >