toUtf8

fnstring toUtf8(const(ubyte)[] bytes, const(char)[] encoding = null, const(char)[] transportCharset = null)

Convert html to UTF-8. encoding is a label ("utf-8", "latin1", "windows-1251", ...); if null it's found with sniffEncoding (transportCharset is the charset of the HTTP Content-Type, if known). Invalid sequences become U+FFFD. It throws ParserinoException for unsupported encodings.