Mica::Core::Encoding
Inherits Enum < Comparable < Value < Object
The character encodings Mica decodes in Crystal (no iconv).
UTF-8 is read in place; the others go through Core::Transcoder, which
turns them into UTF-8 for the format's scanner.
Constants
UTF8 = 0
UTF16LE = 1
UTF16BE = 2
UTF32LE = 3
UTF32BE = 4
ISO8859_1 = 5
USASCII = 6
Class methods
Returns the encoding a byte order mark announces at the start of
bytes and the mark's size, or nil. UTF-32LE wins over UTF-16LE when
the four bytes FF FE 00 00 are present.
Mica::Core::Encoding.from_byte_order_mark(Bytes[0xFE, 0xFF, 0, 0x3C]) # => {Mica::Core::Encoding::UTF16BE, 2}
Looks up an encoding by name, ignoring ASCII case. Accepts the IANA
names and common aliases. "UTF-16" and "UTF-32" (no byte order)
map to the big-endian form, which is what they mean without a byte
order mark; formats that read a mark compare it separately.