From f0d064a6e356436f7cd462cd74df19327b689fa5 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Wed, 30 Jan 2019 18:59:39 +0100 Subject: [PATCH] Windows: compute_utf8fn did not strip path when needed --- src/common/utf8fn.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/utf8fn.cpp b/src/common/utf8fn.cpp index 9c2f4140..c3a52985 100644 --- a/src/common/utf8fn.cpp +++ b/src/common/utf8fn.cpp @@ -7,15 +7,15 @@ using namespace std; string compute_utf8fn(const RclConfig *config, const string& ifn, bool simple) { + string lfn(simple ? path_getsimple(ifn) : ifn); #ifdef _WIN32 // On windows file names are read as UTF16 wchar_t and converted to UTF-8 // while scanning directories - return ifn; + return lfn; #else string charset = config->getDefCharset(true); string utf8fn; int ercnt; - string lfn(simple ? path_getsimple(ifn) : ifn); if (!transcode(lfn, utf8fn, charset, "UTF-8", &ercnt)) { LOGERR("compute_utf8fn: fn transcode failure from [" << charset << "] to UTF-8 for: [" << lfn << "]\n");