Skip to content

Fix for #962: Playlist parser encoding issues and early exit with bad filepaths#966

Open
kstauch wants to merge 1 commit intoprojectM-visualizer:masterfrom
kstauch:fix/playlist-encoding-issue
Open

Fix for #962: Playlist parser encoding issues and early exit with bad filepaths#966
kstauch wants to merge 1 commit intoprojectM-visualizer:masterfrom
kstauch:fix/playlist-encoding-issue

Conversation

@kstauch
Copy link

@kstauch kstauch commented Feb 19, 2026

  • Changed .string() conversions in AddPath and Sort to .u8string() to prevent special characters from failing to convert.
  • Moved try/catch in AddPath inside for loop to prevent a file error from breaking function.
  • Does not address 'Todo: Add failure feedback' in catch block, since I am not sure of the original preferred/intended method for error feedback in this case.

…revent special characters from failing to convert. Moved try/catch in AddPath inside for loop to prevent a file error from breaking function.
@kstauch kstauch marked this pull request as ready for review February 19, 2026 02:42
@OfficialIncubo
Copy link
Contributor

OfficialIncubo commented Feb 19, 2026

Well, I'll take an issue reference of this: #962

EDIT: In title, it's #962, not #982.
Also add in body: Closes #962 or Fixes #962.

currentIndex = index + presetsAdded;
}
if (AddItem(entry.path().string(), currentIndex, allowDuplicates))
if (AddItem(entry.path().u8string(), currentIndex, allowDuplicates))
Copy link
Member

@kblaschke kblaschke Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

u8string() is a C++20 extension. Currently, projectM has a guarantee to compile with C++14 or higher for maximum compatibility, so this function can't be used as of now. Additionally, boost::filesystem doesn't implement this method either.

If you can implement a fix that uses u8string() when the user actively uses C++20 with the STL std::filesystem implementation, but provide a C++14-compatible/Boost fallback that does the same, it can be merged.

@kblaschke kblaschke changed the title Fix for #982: Playlist parser encoding issues and early exit with bad filepaths Fix for #962: Playlist parser encoding issues and early exit with bad filepaths Feb 26, 2026
@kblaschke kblaschke added the bug The issue is (potentially) a bug. label Feb 26, 2026
Copy link
Member

@kblaschke kblaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As commented above, this must still compile with C++14/17 and using Boost's filesystem implementation, so a fix would have to provide a custom conversion function in these cases that mimics what u8string() does.

Applications should also be aware of this, as on Windows, UTF-8 filenames aren't really supported (it uses wchar-encoded names), so this might require adding a note in the API Doxygen comments as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug The issue is (potentially) a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DEV BUG] Preset playlist parser stops when it contains random/cyrillic characters

3 participants