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
|
File-to-File Character Encoding ConversionConvert 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: us-ascii
import com.chilkatsoft.*; public class ChilkatExample { static { try { System.loadLibrary("chilkat"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load.\n" + e); System.exit(1); } } public static void main(String argv[]) { CkCharset charset = new CkCharset(); // Any string argument automatically begins the 30-day trial. boolean success; success = charset.UnlockComponent("30-day trial"); if (success != true) { System.out.println(charset.lastErrorText()); return; } // Set the "To" and "From" character encodings: charset.put_FromCharset("shift_JIS"); charset.put_ToCharset("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 = charset.ConvertFile("japanese_shiftJis.txt","japanese_utf8.txt"); if (success != true) { System.out.println(charset.lastErrorText()); } else { System.out.println("Success"); } } } |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.