Skip to content

Commit 197be32

Browse files
committed
Discovery: Windows: Don't check if a server file name can be encoded
Because on windows, all filename can be encoded: The file system uses UTF-16, regardless of the locale Issue: #6810
1 parent 36ca910 commit 197be32

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/csync/csync_update.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "csync_update.h"
3939
#include "csync_util.h"
4040
#include "csync_misc.h"
41+
#include "common/utility.h"
4142

4243
#include "vio/csync_vio.h"
4344

@@ -147,9 +148,10 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
147148
}
148149

149150
auto localCodec = QTextCodec::codecForLocale();
150-
if (ctx->current == REMOTE_REPLICA && localCodec->mibEnum() != 106) {
151+
if (!OCC::Utility::isWindows() && ctx->current == REMOTE_REPLICA && localCodec->mibEnum() != 106) {
151152
/* If the locale codec is not UTF-8, we must check that the filename from the server can
152153
* be encoded in the local file system.
154+
* (Note: on windows, the FS is always UTF-16, so we don't need to check)
153155
*
154156
* We cannot use QTextCodec::canEncode() since that can incorrectly return true, see
155157
* https://bugreports.qt.io/browse/QTBUG-6925.

0 commit comments

Comments
 (0)