C# UTF8Encoding HeaderName

Description

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

Syntax

UTF8Encoding.HeaderName has the following syntax.


public virtual string HeaderName { get; }

Example


using System;/*from www. j a  va 2  s.  c o  m*/
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.CodePage );
         Console.WriteLine( e.BodyName );
         Console.WriteLine( e.HeaderName );
         Console.WriteLine( e.WebName );
         Console.WriteLine( e.EncodingName );
      }
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding