C# Encoding BodyName

Description

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

Syntax

Encoding.BodyName has the following syntax.


public virtual string BodyName { get; }

Example


using System;/*  w w  w  .  j  a  v a2 s  .  c om*/
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.BodyName );
      }
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding