navidrome/utils/ioutils
Steve b9949ce9e1 fix(ioutils): decide Latin-1 fallback per file, not per character - #6037
Addresses the Codex review on #6063. The previous version chose the encoding
one character at a time, so a genuinely Windows-1252 file that happened to
contain a byte pair which is also valid UTF-8 (for example '£' as C2 A3) had
that pair decoded differently from the rest of the file, leaving the affected
track unmatched.

UTF8Reader now judges the whole BOM-less input: it keeps the bytes when they
are valid UTF-8 and otherwise decodes the entire input as Windows-1252. BOM
and UTF-16 handling stay as a stream and are unchanged.

Signed-off-by: Steve <stevejason639@gmail.com>
2026-09-03 10:20:16 +05:30
..
ioutils.go fix(ioutils): decide Latin-1 fallback per file, not per character - #6037 2026-09-03 10:20:16 +05:30
ioutils_test.go fix(ioutils): decide Latin-1 fallback per file, not per character - #6037 2026-09-03 10:20:16 +05:30