C# Encoding WindowsCodePage

Description

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

Syntax

Encoding.WindowsCodePage has the following syntax.


public virtual int WindowsCodePage { get; }

Example


using System;/*w ww  .j a  va2s . co 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