ASP Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++DelphiFoxProJavaPerlPythonRubySQL ServerVBScript

ASP Examples

ASP String
ASP Byte Array
Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
S/MIME
Socket
Spider
RSA Encryption
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

Encoding/Decoding - Hex, Base64, URL, Quoted-Printable w/ any Charset

The Chilkat ASP String Component is freeware and may be used in any ASP application. To install, download and unzip the ASP String Component. Then copy the CkString.dll to a directory on your ASP Web Server and register it with regsvr32.exe.

Demonstrates how to encode/decode strings in various encodings w/ any charset.

<% @CodePage = 1252 %>
<% Response.CodePage = 1252 %> 

<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></head>
<body>
<%

set cks = Server.CreateObject("CkString.CkString")

' Demonstrate how to encode/decode strings.
s = "eèéêë"

cks.Append s

Response.Write "<p>"
Response.Write cks.Str

Response.Write "<br>"
Response.Write "hex, windows-1252: " & cks.GetEncoded("hex","windows-1252")
Response.Write "<br>"
Response.Write "hex, utf-8: " & cks.GetEncoded("hex","utf-8")
Response.Write "<br>"
Response.Write "url-encoded, windows-1252: " & cks.GetEncoded("url","windows-1252")
Response.Write "<br>"
Response.Write "url-encoded, utf-8: " & cks.GetEncoded("url","utf-8")
Response.Write "<br>"
Response.Write "base64, windows-1252: " & cks.GetEncoded("base64","windows-1252")
Response.Write "<br>"
Response.Write "base64, utf-8: " & cks.GetEncoded("base64","utf-8")
Response.Write "<br>"
Response.Write "quoted-printable, windows-1252: " & cks.GetEncoded("quoted-printable","windows-1252")
Response.Write "<br>"
Response.Write "quoted-printable, utf-8: " & cks.GetEncoded("quoted-printable","utf-8")
Response.Write "</p>"

' Prints this:
' hex, windows-1252: 65E8E9EAEB
' hex, utf-8: 65C3A8C3A9C3AAC3AB
' url-encoded, windows-1252: e%E8%E9%EA%EB
' url-encoded, utf-8: e%C3%A8%C3%A9%C3%AA%C3%AB
' base64, windows-1252: Zejp6us=
' base64, utf-8: ZcOow6nDqsOr
' quoted-printable, windows-1252: e=E8=E9=EA=EB
' quoted-printable, utf-8: e=C3=A8=C3=A9=C3=AA=C3=AB

' Demonstrate decoding by appending the encoded form and outputting
' the string.

' All of the following Response.Write lines print "eèéêë"
cks.Clear
cks.AppendEncoded "65E8E9EAEB","hex","windows-1252"
Response.Write cks.Str & "<br>"

cks.Clear
cks.AppendEncoded "65C3A8C3A9C3AAC3AB","hex","utf-8"
Response.Write cks.Str & "<br>"

cks.Clear
cks.AppendEncoded "e%E8%E9%EA%EB","url","windows-1252"
Response.Write cks.Str & "<br>"

cks.Clear
cks.AppendEncoded "e%C3%A8%C3%A9%C3%AA%C3%AB","url","utf-8"
Response.Write cks.Str & "<br>"

cks.Clear
cks.AppendEncoded "Zejp6us=","base64","windows-1252"
Response.Write cks.Str & "<br>"

cks.Clear
cks.AppendEncoded "ZcOow6nDqsOr","base64","utf-8"
Response.Write cks.Str & "<br>"

cks.Clear
cks.AppendEncoded "e=E8=E9=EA=EB","quoted-printable","windows-1252"
Response.Write cks.Str & "<br>"

cks.Clear
cks.AppendEncoded "e=C3=A8=C3=A9=C3=AA=C3=AB","quoted-printable","utf-8"
Response.Write cks.Str & "<br>"


%>
</body>
</html>
 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.