From 414a4a97fb28cf655db9b84ba3995f1988ad58b2 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 15 Aug 2020 11:43:14 +0200 Subject: [PATCH] Use unicode option when replacing non-words Fixes #513 --- src/collection/collectionmodel.cpp | 2 +- src/context/contextalbumsmodel.cpp | 2 +- src/playlist/playlistmanager.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/collection/collectionmodel.cpp b/src/collection/collectionmodel.cpp index d18096108..beb1d5130 100644 --- a/src/collection/collectionmodel.cpp +++ b/src/collection/collectionmodel.cpp @@ -1442,7 +1442,7 @@ QString CollectionModel::SortText(QString text) { else { text = text.toLower(); } - text = text.remove(QRegularExpression("[^\\w ]")); + text = text.remove(QRegularExpression("[^\\w ]", QRegularExpression::UseUnicodePropertiesOption)); return text; diff --git a/src/context/contextalbumsmodel.cpp b/src/context/contextalbumsmodel.cpp index cb9b73136..b63b59887 100644 --- a/src/context/contextalbumsmodel.cpp +++ b/src/context/contextalbumsmodel.cpp @@ -367,7 +367,7 @@ QString ContextAlbumsModel::SortText(QString text) { else { text = text.toLower(); } - text = text.remove(QRegularExpression("[^\\w ]")); + text = text.remove(QRegularExpression("[^\\w ]", QRegularExpression::UseUnicodePropertiesOption)); return text; diff --git a/src/playlist/playlistmanager.cpp b/src/playlist/playlistmanager.cpp index d5b76a932..950140409 100644 --- a/src/playlist/playlistmanager.cpp +++ b/src/playlist/playlistmanager.cpp @@ -234,7 +234,7 @@ void PlaylistManager::SaveWithUI(int id, const QString &playlist_name) { QString filter = settings.value("last_save_filter", parser()->default_filter()).toString(); QString suggested_filename = playlist_name; - suggested_filename.replace(QRegularExpression("\\W"), ""); + suggested_filename.replace(QRegularExpression("\\W", QRegularExpression::UseUnicodePropertiesOption), ""); qLog(Debug) << "Using extension:" << extension;