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

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

utf-8 to Shift-JIS Conversion

Download C# Project Files and Source Code

C# source code example showing how to convert utf-8 text to the Shift-JIS character encoding.

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

	// Read utf-8 text from a file.
	System.IO.FileInfo fInfo = new System.IO.FileInfo("utf8Sample.txt");
	System.IO.BinaryReader br = new System.IO.BinaryReader(
		System.IO.File.OpenRead("utf8Sample.txt"));
	byte [] utf8Bytes = br.ReadBytes((int)fInfo.Length);
	br.Close();

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

	// Write the output file in Shift-JIS
	// Write the encrypted binary file.
	System.IO.BinaryWriter bw = new System.IO.BinaryWriter(
		System.IO.File.Create("shiftJisSample.txt"));
	bw.Write(shiftJisBytes);
	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