From 1d024c8add7fab3f680ab8389f9ad983967dd7c2 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Tue, 16 Apr 2019 16:31:12 -0500 Subject: [PATCH] Fix u8 string literal C++20 compile error. --- Source/Core/Core/Boot/Boot.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index 850bf9bd3e..f34468d2f9 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -76,10 +76,13 @@ static std::vector ReadM3UFile(const std::string& m3u_path, std::string line; while (std::getline(s, line)) { - if (StringBeginsWith(line, u8"\uFEFF")) + // This is the UTF-8 representation of U+FEFF. + const std::string utf8_bom = "\xEF\xBB\xBF"; + + if (StringBeginsWith(line, utf8_bom)) { WARN_LOG(BOOT, "UTF-8 BOM in file: %s", m3u_path.c_str()); - line.erase(0, 3); + line.erase(0, utf8_bom.length()); } if (!line.empty() && line.front() != '#') // Comments start with #