Removed potential utf8-bom found in some lyrics

This commit is contained in:
emeric
2024-10-26 20:05:03 +02:00
parent 2d28ea61eb
commit 1e3dad7acc
2 changed files with 21 additions and 0 deletions
+5
View File
@@ -159,6 +159,11 @@ namespace lms::metadata
{
std::string_view trimmedLine{ core::stringUtils::stringTrimEnd(line) };
// Remove potential UTF8 BOM
constexpr std::string_view utf8BOM{ "\xEF\xBB\xBF" };
if (trimmedLine.starts_with(utf8BOM))
trimmedLine = trimmedLine.substr(utf8BOM.size());
// Skip comments
if (!trimmedLine.empty() && trimmedLine.front() == '#')
continue;