From ca05fc678ba2b42317917a6118bf8786fec7c6c3 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 29 Sep 2021 13:47:29 +0200 Subject: [PATCH] App: correctly handle UTF-8 encoded path names under Windows --- src/App/Document.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 30f3b69f68..1f108b8df3 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -2613,7 +2613,12 @@ bool Document::saveToFile(const char* filename) const } Base::FileInfo tmp(fn); // In case some folders in the path do not exist +#ifdef FC_OS_WIN32 + QString utf8Name = QString::fromUtf8(filename); + auto parentPath = fs::absolute(fs::path(utf8Name.toStdWString())).parent_path(); +#else auto parentPath = fs::absolute(fs::path(filename)).parent_path(); +#endif fs::create_directories(parentPath); // open extra scope to close ZipWriter properly