Programming Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

C Examples

Bounced Mail
Bz2
Certificates/Keys
Charset
CSV
DKIM / DomainKey
Diffie-Hellman
DSA
Email Object
Encryption
FileAccess
FTP
HTML Conversion
HTTP
IMAP
MHT / HTML Email
MIME
NTLM
POP3
RSA
SMTP
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
Tar
Upload
XML
Zip
Amazon S3

 

 

 

 

 

 

 

 

File-to-File Character Encoding Conversion

Convert a text file from one character encoding to another.

The source/destination charset may be any of the following: The source/destination charset may be any of the following:
(Scroll down to see source code listing)

us-ascii
unicode
unicodefffe
iso-8859-1
iso-8859-2
iso-8859-3
iso-8859-4
iso-8859-5
iso-8859-6
iso-8859-7
iso-8859-8
iso-8859-9
iso-8859-13
iso-8859-15
windows-874
windows-1250
windows-1251
windows-1252
windows-1253
windows-1254
windows-1255
windows-1256
windows-1257
windows-1258
utf-7
utf-8
utf-32
utf-32be
shift_jis
gb2312
ks_c_5601-1987
big5
iso-2022-jp
iso-2022-kr
euc-jp
euc-kr
macintosh
x-mac-japanese
x-mac-chinesetrad
x-mac-korean
x-mac-arabic
x-mac-hebrew
x-mac-greek
x-mac-cyrillic
x-mac-chinesesimp
x-mac-romanian
x-mac-ukrainian
x-mac-thai
x-mac-ce
x-mac-icelandic
x-mac-turkish
x-mac-croatian
asmo-708
dos-720
dos-862
ibm037
ibm437
ibm500
ibm737
ibm775
ibm850
ibm852
ibm855
ibm857
ibm00858
ibm860
ibm861
ibm863
ibm864
ibm865
cp866
ibm869
ibm870
cp875
koi8-r
koi8-u

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
FreeBSD C++ Libraries
HP-UX C++ Libraries
BlackBerry QNX C++ Libraries
#include <C_CkCharset.h>

void ChilkatSample(void)
    {
    HCkCharset charset;
    BOOL success;

    charset = CkCharset_Create();

    //  Any string argument automatically begins the 30-day trial.

    success = CkCharset_UnlockComponent(charset,"30-day trial");
    if (success != TRUE) {
        printf("%s\n",CkCharset_lastErrorText(charset));
        return;
    }

    //  Set the "To" and "From" character encodings:
    CkCharset_putFromCharset(charset,"shift_JIS");
    CkCharset_putToCharset(charset,"utf-8");

    //  To do file-to-file conversion, call ConvertFile.
    //  The shift_JIS sample file is downloadable from this URL:
    //  http://www.chilkatsoft.com/testData/japanese_shiftJis.txt
    success = CkCharset_ConvertFile(charset,"japanese_shiftJis.txt","japanese_utf8.txt");
    if (success != TRUE) {
        printf("%s\n",CkCharset_lastErrorText(charset));
    }
    else {
        printf("Success\n");
    }


    CkCharset_Dispose(charset);

    }

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

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