Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Re-Encode (How to convert encodings)Demonstrates how to convert a string from one encoding to another. Downloads: MS Windows Visual C/C++ Libraries Linux/CentOS C/C++ Libraries MAC OS X C/C++ Libraries Solaris C/C++ Libraries C++ Builder Libraries #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); } |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.