]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
on windows file names can always be encoded: fix wrong test
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Mon, 14 Aug 2023 16:40:49 +0000 (18:40 +0200)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 16 Aug 2023 08:44:37 +0000 (10:44 +0200)
inspired by https://github.com/owncloud/client/pull/6820

Close #5935

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/discovery.cpp

index 8d24b56f633a87b0ee76365ada681d2372faf8ca..ee694c2bb0315951ac2a7ebb9eeb4a14fdd9eaf6 100644 (file)
@@ -291,10 +291,10 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const Entries &ent
     }
 
     auto localCodec = QTextCodec::codecForLocale();
-    if (localCodec->mibEnum() != 106) {
+    if (!OCC::Utility::isWindows() && localCodec->mibEnum() != 106) {
         // If the locale codec is not UTF-8, we must check that the filename from the server can
         // be encoded in the local file system.
-        //
+        // (Note: on windows, the FS is always UTF-16, so we don't need to check)        //
         // We cannot use QTextCodec::canEncode() since that can incorrectly return true, see
         // https://bugreports.qt.io/browse/QTBUG-6925.
         QTextEncoder encoder(localCodec, QTextCodec::ConvertInvalidToNull);