Visual Basic Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB Examples

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

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


VB Strings
VB Byte Array

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

 

 

 

 

 

 

 

Decode HTML Entities

Download Chilkat Charset ActiveX

Visual Basic example program showing how to decode HTML entities.

    Dim cc As New ChilkatCharset2
    cc.UnlockComponent "anything for 30-day trial"

    ' This file can be downloaded from:
    ' http://www.chilkatsoft.com/text-samples/html_entities.txt
    ' The html_entities.txt file contains lines such as:
    ' pound sign  £     £  £        
    ' cent sign   ¢  ¢  ¢        
    ' pound sign  £     £  £        
    ' currency sign   ¤    ¤  ¤        
    ' yen sign = yuan sign    ¥   ¥  ¥        
    ' Latin small letter ae = Latin small ligature ae     æ     æ  æ        
    ' Latin small letter c with cedilla   ç    ç  ç        
    ' Latin small letter e with grave     è    è  è        
    ' Latin small letter e with acute     é    é  é        
    ' Latin small letter e with circumflex    ê     ê  ê        
    ' Latin small letter e with diaeresis     ë  ë  ë        
    ' Latin small letter i with grave     ì    ì  ì        
    ' Latin small letter i with acute     í    í  í        
    ' Latin small letter i with circumflex    î     î  î        
    ' Latin small letter i with diaeresis     ï  ï  ï        
    ' Latin small letter eth  ð   ð  ð        
    
    ' First, load the text file into a VB string:
    Dim textData As Variant
    textData = cc.ReadFile("html_entities.txt")
    cc.FromCharset = "iso-8859-1"
    Text3.Text = cc.ConvertToUnicode(textData)
    
    ' Because HTML entities may represent characters in any language,
    ' the result of the entity decoding is always utf-8.
    ' Therefore, we first decode and then convert to a VB string (from utf-8)
    Dim decoded As Variant
    decoded = cc.HtmlEntityDecode(Text3.Text)
    cc.FromCharset = "utf-8"
    Text4.Text = cc.ConvertToUnicode(decoded)

    ' Alternatively, we can decode the entities directly from file-to-file:
    cc.ToCharset = "iso-8859-1"
    cc.HtmlEntityDecodeFile "html_entities.txt", "html_entities_decoded.txt"

 

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

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