C# ASCIIEncoding CodePage

Description

ASCIIEncoding CodePage When overridden in a derived class, gets the code page identifier of the current Encoding.

Syntax

ASCIIEncoding.CodePage has the following syntax.


public virtual int CodePage { get; }

Example


using System;/*from   w w w .ja v a  2s. com*/
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);
        }
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding