Skip to main content

decode_text_strict

Function decode_text_strict 

Source
pub fn decode_text_strict(
    bytes: &[u8],
    encoding: TextEncoding,
) -> Result<String, DecodeTextError>
Expand description

Decodes bytes into Unicode text using strict lossless behavior.

§Errors

DecodeTextError where the input holds a byte sequence encoding cannot represent, naming the first offending byte’s index. Nothing is replaced; use decode_text for the lossy reading.