Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual C++ Examples

CkString
Byte Array
Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
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

 

 

 

 

 

 

 

 

Re-Encode a String (Hex, Base64, URL, etc)

Demonstrates how to convert from one encoding to another. For example: base64 to hex, URL to base64, base64 to quoted-printable, etc.

Note: The ReEncode method is unreleased at the time of this writing (08-April-2008) The next major Chilkat Crypt2 release after this date will include the ReEncode method.

Download Chilkat C/C++ Libraries for VC++ 9.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 8.0 / Win32

Download Chilkat C/C++ 64-bit Libraries for VC++ 8.0 / x64

Download Chilkat Visual Studio 2005 C/C++ Libs for Windows Mobile, Pocket PC, SmartPhone, WinCE

Download Chilkat C/C++ Libraries for VC++ 7.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 6.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 6.0, Win 95/98/NT4 Compatible

#include <CkCrypt2.h>

void ChilkatSample(void)
    {

    CkCrypt2 crypt;

    //  Any string argument automatically begins the 30-day trial.
    bool success;
    success = crypt.UnlockComponent("30-day trial");
    if (success != true) {
        printf("Crypt component unlock failed\n");
        return;
    }

    const char * hexStr;
    hexStr = "41424344E0E1E2E3";

    const char * fromEncoding;
    fromEncoding = "hex";
    const char * toEncoding;
    toEncoding = "base64";

    //  Convert from hex to base64
    const char * base64;
    base64 = crypt.reEncode(hexStr,fromEncoding,toEncoding);
    printf("%s\n",base64);

    //  Now convert from base64 to quoted-printable:
    fromEncoding = "base64";
    toEncoding = "quoted-printable";
    const char * qp;
    qp = crypt.reEncode(base64,fromEncoding,toEncoding);
    printf("%s\n",qp);

    //  Now convert from quoted-printable to URL:
    fromEncoding = "quoted-printable";
    toEncoding = "url";
    const char * urlEnc;
    urlEnc = crypt.reEncode(qp,fromEncoding,toEncoding);
    printf("%s\n",urlEnc);

    //  Now convert from URL back to hex:
    fromEncoding = "url";
    toEncoding = "hex";
    hexStr = crypt.reEncode(urlEnc,fromEncoding,toEncoding);
    printf("%s\n",hexStr);

    //  The output of this program is:
    //  QUJDRODh4uM=
    //  ABCD=E0=E1=E2=E3
    //  ABCD%E0%E1%E2%E3
    //  41424344E0E1E2E3

    }

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

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

Mail Component · .NET Mail Component · XML Parser