C# Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript



C# Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML to XML
HTTP
IMAP
Encryption
MHT / HTML Email
MIME
RSA Encryption
S/MIME
Socket
Spider
Tar Archive
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
POP3
SMTP
RSS
Atom
String
Byte Array
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
SSH Key
SSH
SSH Tunnel
SFTP

Unreleased...
Bzip2
LZW
Bz2
Icon

 

 

 

 

 

 

Shift-JIS to UTF-8 Conversion

Download C# Project Files and Source Code

C# source code sample program demonstrating how to convert Shift-JIS Japanese character data to utf-8.

private void button1_Click(object sender, System.EventArgs e)
{
	Chilkat.Charset cc = new Chilkat.Charset();
	cc.UnlockComponent("Anything begins 30-day trial");

	// Read Shift-JIS text from a file.
	System.IO.FileInfo fInfo = new System.IO.FileInfo("shiftJisSample.txt");
	System.IO.BinaryReader br = new System.IO.BinaryReader(
		System.IO.File.OpenRead("shiftJisSample.txt"));
	byte [] shiftJisBytes = br.ReadBytes((int)fInfo.Length);
	br.Close();

	// Convert from Shift-JIS to utf-8
	cc.ToCharset = "utf-8";
	cc.FromCharset = "Shift_JIS";
	byte [] utf8Bytes = cc.ConvertData(shiftJisBytes);

	// Write the output file in Shift-JIS
	System.IO.BinaryWriter bw = new System.IO.BinaryWriter(
		System.IO.File.Create("utf8Sample.txt"));
	bw.Write(utf8Bytes);
	bw.Close();
}

 

 

 

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

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

Email Component · XML Parser