C# UnicodeEncoding IsSingleByte

Description

UnicodeEncoding IsSingleByte When overridden in a derived class, gets a value indicating whether the current encoding uses single-byte code points.

Syntax

UnicodeEncoding.IsSingleByte has the following syntax.


[ComVisibleAttribute(false)]
public virtual bool IsSingleByte { get; }

Example


using System;/*from w ww. ja  v  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.Write( "{0,-6} {1,-25} ", ei.CodePage, ei.Name );
         Console.WriteLine(e.IsSingleByte);
      }

   }

}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding