module

VT::UTF8

src/vt/utf8.cr A zero-allocation streaming UTF-8 decoder mixin.

Instance methods

decode_byte(byte : UInt8) : Char | Nil

Consumes a single byte and returns a decoded Char if a valid UTF-8 sequence completes, nil if expecting more bytes, or the Unicode replacement character (U+FFFD) if an invalid sequence is encountered.

Source