Java Requires Chilkat v11.1.0+
Chilkat2 Java
HTML Encoding
Demonstrates HTML encoding and decoding.Chilkat Java Downloads
import com.chilkatsoft.chilkat2.Crypt2;
public class ChilkatExample {
public static void main(String[] args) {
Crypt2 crypt = new Crypt2();
String s = "< é ü ç Ω Hello & World ✓ >";
String htmlEncoded = crypt.encodeString(s, "utf-8", "html");
System.out.println(htmlEncoded);
// Output:
// < é ü ç Ω Hello & World ✓ >
// To decode:
s = crypt.decodeString(htmlEncoded, "utf-8", "html");
System.out.println(s);
// Output:
// < é ü ç Ω Hello & World ✓ >
}
}