C# UnicodeEncoding CharSize

Description

UnicodeEncoding CharSize Represents the Unicode version 2.0 character size in bytes. This field is a constant.

Syntax

UnicodeEncoding.CharSize has the following syntax.


public const int CharSize

Example

Represents the Unicode version 2.0 character size in bytes.


//  www  .  j ava  2 s .  co m
using System;
using System.Text;

class UnicodeEncodingExample {
    public static void Main() {
        Console.WriteLine(
            "Unicode character size: {0} bytes",
            UnicodeEncoding.CharSize
        );
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding