C# UTF8Encoding BodyName

Description

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

Syntax

UTF8Encoding.BodyName has the following syntax.


public virtual string BodyName { get; }

Example


using System;//from  ww  w.ja  va  2s.  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