quintodrome/tests/fixtures/playlists
Deluan Quintão 91fab68578
fix: handle UTF BOM in lyrics and playlist files (#4637)
* fix: handle UTF-8 BOM in lyrics and playlist files

Added UTF-8 BOM (Byte Order Mark) detection and stripping for external lyrics files and playlist files. This ensures that files with BOM markers are correctly parsed and recognized as synced lyrics or valid playlists.

The fix introduces a new ioutils package with UTF8Reader and UTF8ReadFile functions that automatically detect and remove UTF-8, UTF-16 LE, and UTF-16 BE BOMs. These utilities are now used when reading external lyrics and playlist files to ensure consistent parsing regardless of BOM presence.

Added comprehensive tests for BOM handling in both lyrics and playlists, including test fixtures with actual BOM markers to verify correct behavior.

* test: add test for UTF-16 LE encoded LRC files

Signed-off-by: Deluan <deluan@navidrome.org>

---------

Signed-off-by: Deluan <deluan@navidrome.org>
2025-10-31 09:07:23 -04:00
..
subfolder1 Ignore playlists starting with a dot - #2367 (#2390) 2023-06-16 15:55:17 -04:00
subfolder2 fix(server): import absolute paths in m3u (#3756) 2025-02-26 22:26:38 -05:00
bom-test-utf16.m3u fix: handle UTF BOM in lyrics and playlist files (#4637) 2025-10-31 09:07:23 -04:00
bom-test.m3u fix: handle UTF BOM in lyrics and playlist files (#4637) 2025-10-31 09:07:23 -04:00
cr-ended.m3u Handle CR, LF and CRLF line endings when importing Playlists 2020-08-19 12:22:41 -04:00
invalid_json.nsp feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
lf-ended.m3u Handle CR, LF and CRLF line endings when importing Playlists 2020-08-19 12:22:41 -04:00
pls-with-name.m3u fix(server): preserve m3u file order on import (#3314) 2024-09-27 16:05:12 -04:00
pls-without-name.m3u fix(server): preserve m3u file order on import (#3314) 2024-09-27 16:05:12 -04:00
pls1.m3u fix(server): import absolute paths in m3u (#3756) 2025-02-26 22:26:38 -05:00
recently_played.nsp Fix typo 2024-04-20 13:16:50 -04:00