Charset
@Serializable { simple=true }
const class Charset : Obj
Charset represents a specific character encoding. It is used to decode bytes to Unicode characters, and encode Unicode characters to bytes.
Attempt to lookup a Charset by name
Default value is utf8
Charset equality is based on the character set name ignoring case (names are not case-sensitive)
Compute hash code based on case-insensitive name
Get the name of this character encoding
Return name()
A charset for "UTF-16BE" format (Sixteen-bit UCS Transformation Format, big-endian byte order)
A charset for "UTF-16LE" format (Sixteen-bit UCS Transformation Format, little-endian byte order)
A charset for "UTF-8" format (Eight-bit UCS Transformation Format)
static Charset defVal()
Default value is utf8.
virtual Bool equals(Obj? obj)
Charset equality is based on the character set name ignoring case (names are not case-sensitive).
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.
virtual Int hash()
Compute hash code based on case-insensitive name.
Str name()
Get the name of this character encoding.
virtual Str toStr()
Return name().
static Charset utf16BE()
A charset for "UTF-16BE" format (Sixteen-bit UCS Transformation Format, big-endian byte order).
static Charset utf16LE()
A charset for "UTF-16LE" format (Sixteen-bit UCS Transformation Format, little-endian byte order).
static Charset utf8()
A charset for "UTF-8" format (Eight-bit UCS Transformation Format).