UTF-8 #
The well-formed byte sequences are those of the Unicode Standard, Table 3-7. Encoding, strict
decoding and validation are core's, which are fast. Ill-formed input goes through the decoder of
UTF8.decodeIter: decode reports the byte offset of the first maximal subpart of an ill-formed
byte sequence, and decodeLossy replaces each maximal subpart with U+FFFD, following the
recommended practice of the Standard, Section 3.9. Core's String.fromUTF8Lossy replaces each run
of ill-formed bytes instead, so it can give fewer U+FFFD.
The UTF-8 bytes of c, one to four of them.
Instances For
Decodes the UTF-8 bytes of b, or returns an error with the byte offset of the first maximal
subpart of an ill-formed byte sequence.
Instances For
Decodes the UTF-8 bytes of b, or returns none if b is ill-formed.
Instances For
Decodes the UTF-8 bytes of b, panicking if b is ill-formed.
Instances For
Decodes the UTF-8 bytes of b, replacing each maximal subpart of an ill-formed byte sequence
with U+FFFD.