byte_to_latin1

Function byte_to_latin1 

Source
pub fn byte_to_latin1(bytes: &[u8]) -> Vec<u8> ⓘ
Expand description

Convert a raw byte sequence into a Latin-1 string encoded as UTF-8.

Bytes 0x00..=0x7F pass through; 0x80..=0xFF are emitted as the 2-byte UTF-8 encoding of the same codepoint. Faithful to C++ ByteToLatin1. Stops at the first NUL byte, matching the original.