C# Encoding EncodingName

Description

Encoding EncodingName When overridden in a derived class, gets the human-readable description of the current encoding.

Syntax

Encoding.EncodingName has the following syntax.


public virtual string EncodingName { get; }

Example


using System;/*from w w w .  j av  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.EncodingName );
      }
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding