From 7f1e234f36a759efa3dbe9e3a208a27a27b049c6 Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 16 Mar 2022 19:51:54 +0100 Subject: [PATCH] Fix occurrences of wrong encoding handling with `std::filesystem` --- cli/mainfeatures.cpp | 2 +- gui/tageditorwidget.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/mainfeatures.cpp b/cli/mainfeatures.cpp index d09a67f..e3dd8c6 100644 --- a/cli/mainfeatures.cpp +++ b/cli/mainfeatures.cpp @@ -874,7 +874,7 @@ void setTagInfo(const SetTagInfoArgs &args) auto modifiedFilePath = std::filesystem::path(); fileInfo.setSaveFilePath(currentOutputFile != noMoreOutputFiles ? string(*currentOutputFile) : string()); if (args.preserveModificationTimeArg.isPresent()) { - modifiedFilePath = fileInfo.saveFilePath().empty() ? fileInfo.path() : fileInfo.saveFilePath(); + modifiedFilePath = std::filesystem::u8path(fileInfo.saveFilePath().empty() ? fileInfo.path() : fileInfo.saveFilePath()); modificationDate = std::filesystem::last_write_time(modifiedFilePath, modificationDateError); } try { diff --git a/gui/tageditorwidget.cpp b/gui/tageditorwidget.cpp index c5703aa..e75d24f 100644 --- a/gui/tageditorwidget.cpp +++ b/gui/tageditorwidget.cpp @@ -1187,7 +1187,7 @@ bool TagEditorWidget::startSaving() auto modificationDate = std::filesystem::file_time_type(); auto modifiedFilePath = std::filesystem::path(); if (preserveModificationTime) { - modifiedFilePath = m_fileInfo.saveFilePath().empty() ? m_fileInfo.path() : m_fileInfo.saveFilePath(); + modifiedFilePath = std::filesystem::u8path(m_fileInfo.saveFilePath().empty() ? m_fileInfo.path() : m_fileInfo.saveFilePath()); modificationDate = std::filesystem::last_write_time(modifiedFilePath, modificationDateError); } try {