Expand description
Text encoding utilities for metadata decoding.
Many file formats store text metadata in Latin-1 (ISO 8859-1) or other
non-UTF-8 encodings. These helpers provide correct decoding instead of
the lossy String::from_utf8_lossy() which silently replaces bytes
= 0x80 with U+FFFD.
Functions§
- decode_
latin1 - Decode bytes as Latin-1 (ISO 8859-1) to String.
- decode_
utf8_ or_ latin1 - Try decoding as UTF-8 first; fall back to Latin-1 if invalid.