Fan

 

const final class

sys::Charset

sys::Obj
  sys::Charset

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

Slots

defValSource

static Charset defVal()

Default value is utf8.

equalsSource

override Bool equals(Obj? obj)

Overrides sys::Obj.equals

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

fromStrSource

static Charset? 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.

hashSource

override Int hash()

Overrides sys::Obj.hash

Compute hash code based on case-insensitive name.

nameSource

Str name()

Get the name of this character encoding.

toStrSource

override Str toStr()

Overrides sys::Obj.toStr

Return name().

utf16BESource

static Charset utf16BE()

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

utf16LESource

static Charset utf16LE()

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

utf8Source

static Charset utf8()

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