From f90cb239f3202065ad99026a4db5acd0b5870ab6 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Mon, 14 Aug 2023 18:40:49 +0200 Subject: [PATCH] on windows file names can always be encoded: fix wrong test inspired by https://github.com/owncloud/client/pull/6820 Close #5935 Signed-off-by: Matthieu Gallien --- src/libsync/discovery.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 8d24b56f6..ee694c2bb 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -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); -- 2.30.2