Node.js
Node.js
HTML Encoding
Demonstrates HTML encoding and decoding.Chilkat Node.js Downloads
NODEJS_PRELUDE
function chilkatExample() {
var crypt = new chilkat.Crypt2();
var s = "< é ü ç Ω Hello & World ✓ >";
var htmlEncoded = crypt.EncodeString(s,"utf-8","html");
console.log(htmlEncoded);
// Output:
// < é ü ç Ω Hello & World ✓ >
// To decode:
s = crypt.DecodeString(htmlEncoded,"utf-8","html");
console.log(s);
// Output:
// < é ü ç Ω Hello & World ✓ >
}
chilkatExample();