Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
Re-Encode (How to convert encodings)Demonstrates how to convert a string from one encoding to another.
#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("%s\n",crypt.lastErrorText()); return; } const char * s1; const char * s2; s1 = "This is a test / = abc 123"; // The ReEncode method converts a string from one encoding // to another. // Valid encodings are "url", "base64", "qp", "hex", and "ansi" // Use "ansi" for an unencoded ANSI string. // Encode to URL-encoding: s2 = crypt.reEncode(s1,"ansi","url"); printf("%s\n",s2); // Convert from URL-encoding to base64: const char * b64; b64 = crypt.reEncode(s2,"url","base64"); printf("%s\n",b64); // Convert from base64 to hex: const char * hex; hex = crypt.reEncode(b64,"base64","hex"); printf("%s\n",hex); } |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.