parserino.html.decoder

UTF-8 decoding of the input, as the Encoding standard (the "UTF-8 decode" of the HTML parser): invalid bytes become U+FFFD (one for each "maximal subpart", as browsers do) and a leading byte order mark is removed. The input comes in chunks: a sequence can span two chunks.

Types 1

The UTF-8 decoder of the tokenizer (see the module)

Fields
bool stripBomRemove a byte order mark at the beginning (only for documents, not for fragments)
bool hasCRDid the last result of `decode` contain a '\r'?
Methods
const(char)[] decode(return scope const(char)[] chunk) @nogc nothrow pure @safe returnDecode a chunk. It returns `chunk` itself if it's valid (the common case), else a copy with the replacements, valid until the next call. An incomplete sequence at the end is kept for the next chunk.
const(char)[] finish() @nogc nothrow pure @safeThe end of the input: U+FFFD if a sequence (or a BOM) is incomplete, else empty
bool failed() @nogc nothrow pure @safe constOut of memory

Functions 1

fnsize_t validLength(scope const(char)[] s, out bool hasCR) @nogc nothrow pure @trustedThe length of the longest prefix of `s` that is valid and complete UTF-8. `hasCR` tells if that prefix contains a '\r' (the tokenizer normalizes newlines): one pass for both. ASCII runs are checked...