UTF32

Summary

Provides UTF-32 encoding and decoding.

Description

This class provides UTF-32 encoding and decoding methods.

UTF-32 is a fixed-width character encoding defined by the Unicode Standard. Each Unicode code point is represented using exactly 32 bits.

Examples

Basic Usage
1
2
3
4
5
6
7
8
9
10
11
import System;
import System.Encoding;
  
byte[] encoded = UTF32.encode("�");
  
string toHex = "";
foreach(byte b in encoded) {
    toHex += "\\x" + b.toHex().toUpperCase();
}
  
Console.log(toHex); // "\xFF\xFE\x0\x0\xAC\x20\x0\x0"

Methods

  • decode

    Decodes UTF-32 encoded text.

  • encode

    Encodes a string of text using UTF-32 encoding.

Share

HTML | BBCode | Direct Link