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 {