Skip to content

Commit

Permalink
Allow UTF8 characters in song and filename #4515
Browse files Browse the repository at this point in the history
  • Loading branch information
derwin12 authored and dkulp committed Apr 30, 2024
1 parent 019c30a commit 5cf48a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion xLights/AudioManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "../xSchedule/md5.h"
#include "ExternalHooks.h"
#include "Parallel.h"
#include "UtilFunctions.h"

extern "C"
{
Expand Down Expand Up @@ -2096,7 +2097,7 @@ int AudioManager::OpenMediaFile()
#endif

AVFormatContext* formatContext = nullptr;
int res = avformat_open_input(&formatContext, _audio_file.c_str(), nullptr, nullptr);
int res = avformat_open_input(&formatContext, ToUTF8(_audio_file).c_str(), nullptr, nullptr);
if (res != 0)
{
logger_base.error("avformat_open_input Error opening the file %s => %d.", (const char *) _audio_file.c_str(), res);
Expand Down
2 changes: 1 addition & 1 deletion xLights/controllers/FPPConnectDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ void FPPConnectDialog::LoadSequencesFromFolder(wxString dir) const
case SP_XmlPullEvent::eCData:
if (isMedia) {
SP_XmlCDataEvent * stagEvent = (SP_XmlCDataEvent*)event;
mediaName = wxString::FromAscii(stagEvent->getText()).ToStdString();
mediaName = FromUTF8(stagEvent->getText());
done = true;
}
break;
Expand Down
2 changes: 1 addition & 1 deletion xLights/xLightsXmlFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ bool xLightsXmlFile::LoadSequence(const wxString& ShowDir, bool ignore_audio, co
audio = nullptr;
}
if (::FileExists(mf) && mf.IsFileReadable()) {
mediaFileName = ToUTF8(media_file);
mediaFileName = media_file.ToStdString();
}
else {
if (!::FileExists(mf)) {
Expand Down

0 comments on commit 5cf48a5

Please sign in to comment.