Windows: compute_utf8fn did not strip path when needed

This commit is contained in:
Jean-Francois Dockes 2019-01-30 18:59:39 +01:00
parent 0a09ffc23b
commit f0d064a6e3

View File

@ -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");