UtfType enum

UTF types

Inheritance
Available extensions

Values

none → const UtfType

Not defined yet (can use fallback)

utf8 → const UtfType

Up to 4 bytes per character

utf16be → const UtfType

2 bytes per character, big endian

utf16le → const UtfType

2 bytes per character, little endian

utf32be → const UtfType

4 bytes per character, big endian

utf32le → const UtfType

4 bytes per character, little endian

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getBomLength(bool forWrite) int
Get BOM length
getMaxCharLength(bool forWrite) int
Get maximum number of bytes representing a character
getMinCharLength(bool forWrite) int
Get minimum number of bytes representing a character
isBigEndian(bool forWrite) bool
Check the endianness
isFixedLength(bool forWrite) bool
Flag separating none/UTF-8 and UTF-16/32
isFixedLengthShort(bool forWrite) bool
Check whether this is a 2-byte Unicode
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toBom(bool forWrite, {bool useFallback = false}) List<int>
Convert type to BOM
toFinal(bool forWrite) UtfType
Convert type to BOM
toString() String
Serialize
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

cleanRE RegExp
Const: type to BOM mapping
final
emptyBom Uint8List
Const: type to BOM mapping
final

Static Methods

fromBom(List<int> buffer) UtfType
Determine UTF type based on a sequence of bytes
parse(String? input, [UtfType defValue = none]) UtfType
Convert string to UTF type

Constants

values → const List<UtfType>
A constant List of the values in this enum, in order of their declaration.