pub fn decode_bytes_to_string(bytes: &[u8]) -> StringExpand description
Decode a byte buffer to a String, trying UTF-8 first, then Latin-1.
Latin-1 (ISO-8859-1) maps bytes 0x00-0xFF directly to Unicode U+0000-U+00FF,
so it can decode any byte sequence. This matches Python ScanCode’s use of
UnicodeDammit which auto-detects encoding with Latin-1 as fallback.