Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component

Index of Chilkat Blog Posts

October 19, 2005

Entity Decoding with Chilkat XML

Chilkat XML (and ASP XML) do not automatically entity-decode strings. The reason is that an encoded entity may not be representable in the charset (character encoding) of the XML document. However, Chilkat XML provides the DecodeEntities method for decoding the XML and HTML entities in a string. This will decode everything from entity-encoded symbols, characters with diacritics (accents), and hex/decimal encoded entities. When decoding, the bytes are treated as ANSI characters. Here is a VB6 example that uses the Chilkat XML ActiveX:

<font size=2 face=courier>
    Dim x As New ChilkatXml
    ‘ When entity decoded, this message reads: Hello! <CopyRight><CRLF>ABC ZZZ ABC zzz
    x.LoadXml "<Row Message="\"Hello! ©
ABC ZZZ ABC zzz"\" />"
    Dim s As String
    ‘ Gets the string, but entities are not automatically decoded.
    s = x.GetAttrValue("Message")
    MsgBox s
    ‘ Decode the entities.  The decoded bytes are treated as ANSI characters
    ‘ and converted to Unicode and returned to the (Unicode) VB6 string.
    s = x.DecodeEntities(s)
    MsgBox s

Note: A bug in the DecodeEntities method was fixed, and a new version of Chilkat XML (and ASP XML) is available at

PS> There is no significant difference between ASP XML and Chilkat XML, other that ASP XML is constructed internally for an ASP environment and it includes the LoadRequest method for loading the ASP Request data directly.

Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.