const virtual class std::Charset

sys::Obj
  std::Charset

@Serializable { simple=true }

Charset represents a specific character encoding used to decode bytes to Unicode characters, and encode Unicode characters to bytes.

decode

Int decode(InStream in)

defVal

const static Charset defVal := utf8

Default value is utf8.

encode

Int encode(Int ch, OutStream out)

encodeArray

Int encodeArray(Int ch, Array<Int8> out, Int offset)

encoder

protected const Encoder encoder

equals

virtual override Bool equals(Obj? obj)

Charset equality is based on the character set name ignoring case (names are not case-sensitive).

fromStr

static new fromStr(Str name, Bool checked := true)

Attempt to lookup a Charset by name. Use one of the predefined methods such as utf8 to get a standard encoding. If charset not found and checked is false return null, otherwise throw ParseErr.

hash

virtual override Int hash()

Compute hash code based on case-insensitive name.

name

const Str name

Get the name of this character encoding.

privateMake

new privateMake(Str name, Encoder coder)

Private constructor

toStr

virtual override Str toStr()

Return name().

utf16BE

const static Charset utf16BE := ...

An charset for "UTF-16BE" format (Sixteen-bit UCS Transformation Format, big-endian byte order).

utf16LE

const static Charset utf16LE := ...

An charset for "UTF-16LE" format (Sixteen-bit UCS Transformation Format, little-endian byte order).

utf8

const static Charset utf8 := ...

An charset for "UTF-8" format (Eight-bit UCS Transformation Format).