C# UnicodeEncoding IsReadOnly

Description

UnicodeEncoding IsReadOnly When overridden in a derived class, gets a value indicating whether the current encoding is read-only.

Syntax

UnicodeEncoding.IsReadOnly has the following syntax.


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

Example


using System;//from   w w  w. j  a v a2s  . co  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.IsReadOnly);
      }

   }

}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding