latin1_to_bytes

Function latin1_to_bytes 

Source
pub fn latin1_to_bytes(latin1: &[u8]) -> Result<Vec<u8>, TCodepoint>
Expand description

Convert a Latin-1 string (given as bytes that are themselves valid UTF-8) into the raw Latin-1 byte sequence.

Every codepoint must be in 0x00..=0xFF; ASCII passes through and 0x80..=0xFF is expected as a 2-byte UTF-8 sequence. Returns Err(INVALID_LATIN1) on any out-of-range or malformed input — faithful to C++ Latin1ToBytes.