Create a new instance of the Encoder class : Encoder « Development Class « C# / C Sharp






Create a new instance of the Encoder class

 

using System;
using System.Text;

class EncoderExample {
    public static void Main() {
        UnicodeEncoding uni = new UnicodeEncoding();
        Encoder enc1 = uni.GetEncoder();
        Encoder enc2 = Encoding.Unicode.GetEncoder();
        Console.WriteLine(enc1.ToString());
        Console.WriteLine(enc2.ToString());
        Console.WriteLine(enc1.GetHashCode());
        Console.WriteLine(enc2.GetHashCode());
    }
}

   
  








Related examples in the same category

1.Encoder converts a set of characters into a sequence of bytes.
2.Calculates the number of bytes produced by encoding a set of characters
3.Encode a set of characters from the specified character array