C# Encoding HeaderName

Description

Encoding HeaderName When overridden in a derived class, gets a name for the current encoding that can be used with mail agent header tags.

Syntax

Encoding.HeaderName has the following syntax.


public virtual string HeaderName { get; }

Example


using System;//from  w ww  .  j  a v a 2  s .  com
using System.Text;

public class SamplesEncoding  {
   public static void Main()  {
      foreach( EncodingInfo ei in Encoding.GetEncodings() )  {
         Encoding e = ei.GetEncoding();
         Console.WriteLine(ei.Name );
         Console.WriteLine(e.HeaderName );
      }
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding