m3u: normalize line endings except win32

This commit is contained in:
Craig Carnell 2026-07-11 10:53:59 +01:00
parent 6de526c684
commit 4b55c26cdb

View File

@ -76,6 +76,11 @@ static std::vector<std::string> ReadM3UFile(const std::string& m3u_path,
// This is the UTF-8 representation of U+FEFF.
constexpr std::string_view utf8_bom = "\xEF\xBB\xBF";
#ifndef _WIN32
if (line.ends_with('\r'))
line.pop_back();
#endif
if (line.starts_with(utf8_bom))
{
WARN_LOG_FMT(BOOT, "UTF-8 BOM in file: {}", m3u_path);