Add explicity utf8 conversions on openFromFile SFML calls

This commit is contained in:
Stepland 2022-12-27 18:57:48 +01:00
parent ad48a4c11c
commit b0da3382ec
2 changed files with 4 additions and 3 deletions

View File

@ -11,6 +11,7 @@
#include <stdexcept>
#include "al_check.hpp"
#include "utf8_strings.hpp"
#if defined(__APPLE__)
#if defined(__clang__)
@ -24,7 +25,7 @@ OpenMusic::OpenMusic(const std::filesystem::path& filename) :
m_file(),
m_loopSpan(0, 0)
{
if (not openFromFile(filename)) {
if (not openFromFile(to_utf8_encoded_string(filename))) {
throw std::runtime_error("Could not open "+filename.string());
}
}
@ -41,7 +42,7 @@ bool OpenMusic::openFromFile(const std::filesystem::path& filename) {
stop();
// Open the underlying sound file
if (!m_file.openFromFile(filename)) {
if (!m_file.openFromFile(to_utf8_encoded_string(filename))) {
return false;
}

View File

@ -1459,7 +1459,7 @@ void EditorState::reload_preview_audio() {
const auto path = song_path->parent_path() / song.metadata.preview_file;
preview_audio.emplace();
if (not preview_audio->openFromFile(path.string())) {
if (not preview_audio->openFromFile(to_utf8_encoded_string(path))) {
preview_audio.reset();
}
};