From 7864d76ecaff3ce500c6d3f09910fbb24027efd7 Mon Sep 17 00:00:00 2001 From: Tillsunset <35825944+Tillsunset@users.noreply.github.com> Date: Tue, 20 Sep 2022 07:50:34 -0500 Subject: [PATCH] fixed the string encoding issue on macOS (#277) --- src/gui/MemorySearcherTool.cpp | 4 ++-- src/gui/components/wxLogCtrl.cpp | 5 +++-- src/gui/components/wxTitleManagerList.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/gui/MemorySearcherTool.cpp b/src/gui/MemorySearcherTool.cpp index 3423e73b..5caa163f 100644 --- a/src/gui/MemorySearcherTool.cpp +++ b/src/gui/MemorySearcherTool.cpp @@ -300,14 +300,14 @@ void MemorySearcherTool::Load() bool found = false; for (const auto& entry : kDataTypeNames) { - if (boost::iequals(entry, *option_type)) + if (boost::iequals(entry.ToStdString(), *option_type)) { found = true; break; } } - if (!found && !boost::iequals(kDatatypeString, *option_type)) + if (!found && !boost::iequals(kDatatypeString.ToStdString(), *option_type)) continue; wxVector data; diff --git a/src/gui/components/wxLogCtrl.cpp b/src/gui/components/wxLogCtrl.cpp index 50356d29..732dd26d 100644 --- a/src/gui/components/wxLogCtrl.cpp +++ b/src/gui/components/wxLogCtrl.cpp @@ -68,7 +68,7 @@ void wxLogCtrl::PushEntry(const wxString& filter, const wxString& message) ListIt_t it = m_log_entries.back(); lock.unlock(); - if(m_active_filter.empty() || filter == m_active_filter || (m_filter_messages && boost::icontains(message, m_active_filter))) + if(m_active_filter.empty() || filter == m_active_filter || (m_filter_messages && boost::icontains(message.ToStdString(), m_active_filter))) { std::unique_lock active_lock(m_active_mutex); m_active_entries.emplace_back(std::cref(it)); @@ -149,7 +149,8 @@ void wxLogCtrl::UpdateActiveEntries() { for (const auto& it : m_log_entries) { - if(it.first == m_active_filter || (m_filter_messages && boost::icontains(it.second, m_active_filter)) ) + if(it.first == m_active_filter || + (m_filter_messages && boost::icontains(it.second.ToStdString(), m_active_filter)) ) m_active_entries.emplace_back(it); } } diff --git a/src/gui/components/wxTitleManagerList.cpp b/src/gui/components/wxTitleManagerList.cpp index 8f43630d..c00848c6 100644 --- a/src/gui/components/wxTitleManagerList.cpp +++ b/src/gui/components/wxTitleManagerList.cpp @@ -197,10 +197,10 @@ boost::optional wxTitleManagerList::GetTitleEnt boost::optional wxTitleManagerList::GetTitleEntry(const fs::path& path) const { - const auto tmp = path.generic_u8string(); + const auto tmp = _pathToUtf8(path); for (const auto& data : m_data) { - if (boost::iequals(data->entry.path.generic_u8string(), tmp)) + if (boost::iequals(_pathToUtf8(data->entry.path), tmp)) return data->entry; } @@ -208,10 +208,10 @@ boost::optional wxTitleManagerList::GetTi } boost::optional wxTitleManagerList::GetTitleEntry(const fs::path& path) { - const auto tmp = path.generic_u8string(); + const auto tmp = _pathToUtf8(path); for (const auto& data : m_data) { - if (boost::iequals(data->entry.path.generic_u8string(), tmp)) + if (boost::iequals(_pathToUtf8(data->entry.path), tmp)) return data->entry; }