Node.js
Node.js
HTML Entity Encode and Decode in StringBuilder
Demonstrates HTML encoding and decoding the contents of a StringBuilder.Chilkat Node.js Downloads
NODEJS_PRELUDE
function chilkatExample() {
var sb = new chilkat.StringBuilder();
var s = "< é ü ç Ω Hello & World ✓ >";
sb.Append(s);
sb.Encode("html","utf-8");
console.log(sb.GetAsString());
// Output:
// < é ü ç Ω Hello & World ✓ >
// To decode:
sb.Decode("html","utf-8");
console.log(sb.GetAsString());
// Output:
// < é ü ç Ω Hello & World ✓ >
}
chilkatExample();