[][src]Crate utf8_decode

Structs

Decoder

UTF-8 decoder. Transform the given bytes iterator into a std::io::Result<char> iterator. Since the UTF-8 sequence may be invalid, each character is wrapped around a std::io::Result. A call to Iterator::next returns an InvalidData error if the input iterator does not output a valid UTF-8 sequence, or an UnexpectedEof if the stream ends before the end of a valid character.

UnsafeDecoder

UTF-8 decoder for unsafe input. Transform the given std::io::Result<u8> iterator into a std::io::Result<char> iterator. Since the UTF-8 sequence may be invalid, each character is wrapped around a std::io::Result. A call to Iterator::next returns an InvalidData error if the input iterator does not output a valid UTF-8 sequence, or an UnexpectedEof if the stream ends before the end of a valid character.

Functions

decode

Read the next Unicode character out of the given byte iterator. Returns None is the input iterator directly outputs None. Returns an InvalidData error the input iterator does not output a valid UTF-8 sequence. Returns an UnexpectedEof error if the input iterator returns None before the end of an UTF-8 character.