C# ASCIIEncoding WindowsCodePage

Description

ASCIIEncoding WindowsCodePage When overridden in a derived class, gets the Windows operating system code page that most closely corresponds to the current encoding.

Syntax

ASCIIEncoding.WindowsCodePage has the following syntax.


public virtual int WindowsCodePage { get; }

Example


using System;/*from  w  ww  .  jav a 2 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.WriteLine(ei.Name);
            Console.WriteLine(e.WindowsCodePage);
        }
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding