Fix unicode characters being invalid in filenames

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad 2024-04-06 13:28:42 +01:00
parent 363273a17b
commit 9986fe4c45
No known key found for this signature in database
GPG Key ID: 5E39D70B4C93C38E

View File

@ -807,7 +807,7 @@ static const QString BAD_FILENAME_CHARS = BAD_PATH_CHARS + "\\/";
QString RemoveInvalidFilenameChars(QString string, QChar replaceWith) QString RemoveInvalidFilenameChars(QString string, QChar replaceWith)
{ {
for (int i = 0; i < string.length(); i++) for (int i = 0; i < string.length(); i++)
if (string.at(i).toLatin1() < ' ' || BAD_FILENAME_CHARS.contains(string.at(i))) if (string.at(i) < ' ' || BAD_FILENAME_CHARS.contains(string.at(i)))
string[i] = replaceWith; string[i] = replaceWith;
return string; return string;