Sample code for 30+ languages & platforms
Classic ASP

HTML Entity Encode and Decode in StringBuilder

Demonstrates HTML encoding and decoding the contents of a StringBuilder.

Chilkat Classic ASP Downloads

Classic ASP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
set sb = Server.CreateObject("Chilkat.StringBuilder")

s = "< é ü ç Ω Hello & World ✓ >"
success = sb.Append(s)

success = sb.Encode("html","utf-8")
Response.Write "<pre>" & Server.HTMLEncode( sb.GetAsString()) & "</pre>"

' Output:
' < &eacute; &uuml; &ccedil; &ohm; Hello & World &check; >

' To decode:
success = sb.Decode("html","utf-8")
Response.Write "<pre>" & Server.HTMLEncode( sb.GetAsString()) & "</pre>"

' Output:
' < é ü ç Ω Hello & World ✓ >

%>
</body>
</html>