Classic ASP
Classic ASP
HTML Encoding
Demonstrates HTML encoding and decoding.Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
set crypt = Server.CreateObject("Chilkat.Crypt2")
s = "< é ü ç Ω Hello & World ✓ >"
htmlEncoded = crypt.EncodeString(s,"utf-8","html")
Response.Write "<pre>" & Server.HTMLEncode( htmlEncoded) & "</pre>"
' Output:
' < é ü ç Ω Hello & World ✓ >
' To decode:
s = crypt.DecodeString(htmlEncoded,"utf-8","html")
Response.Write "<pre>" & Server.HTMLEncode( s) & "</pre>"
' Output:
' < é ü ç Ω Hello & World ✓ >
%>
</body>
</html>