Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component

Index of Chilkat Blog Posts

August 1, 2007

Mapping System.Text.Encoding to Email.Charset

Our program has a standard interface to receive System.Text.Encoding to specify subject/content encoding of an email, how can I map these values to Email.Charset property of your component?

The System.Text.Encoding class includes two properties that provide string representations of the charset: EncodingName and WebName. EncodingName is more descriptive and will contain a human readable name such as "Japanese (Shift-JIS)" or "Western European (Windows)". WebName is the name you would pass to any Charset property of an Chilkat object. It would contain something like "shift_jis" or "Windows-1252″.

For example:

	Chilkat.Email email = new Chilkat.Email();
	System.Text.Encoding enc = System.Text.Encoding.GetEncoding(932);
	email.Charset = enc.WebName;

Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.