Lua Requires Chilkat v11.1.0+
Lua
HTML Encoding
Demonstrates HTML encoding and decoding.Chilkat Lua Downloads
local chilkat = require("chilkat")
local crypt = chilkat.Crypt2.new()
local s = "< é ü ç Ω Hello & World ✓ >"
local htmlEncoded = crypt:encode_string(s, "utf-8", "html")
print(htmlEncoded)
-- Output:
-- < é ü ç Ω Hello & World ✓ >
-- To decode:
s = crypt:decode_string(htmlEncoded, "utf-8", "html")
print(s)
-- Output:
-- < é ü ç Ω Hello & World ✓ >