C# EncodingInfo CodePage

Description

EncodingInfo CodePage Gets the code page identifier of the encoding.

Syntax

EncodingInfo.CodePage has the following syntax.


public int CodePage { get; }

Example

Gets the code page identifier of the encoding.


using System;//  ww w .j a v a2  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.Write(ei.CodePage );
      }
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding