Skip to content

Commit

Permalink
Discovery: Windows: Don't check if a server file name can be encoded
Browse files Browse the repository at this point in the history
Because on windows, all filename can be encoded: The file system uses
UTF-16, regardless of the locale

Issue: #6810
  • Loading branch information
ogoffart committed Oct 18, 2018
1 parent 0d5c5b6 commit c24e270
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/csync/csync_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "csync_update.h"
#include "csync_util.h"
#include "csync_misc.h"
#include "common/utility.h"

#include "vio/csync_vio.h"

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

auto localCodec = QTextCodec::codecForLocale();
if (ctx->current == REMOTE_REPLICA && localCodec->mibEnum() != 106) {
if (!OCC::Utility::isWindows() && ctx->current == REMOTE_REPLICA && 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.
Expand Down

0 comments on commit c24e270

Please sign in to comment.