fixed the string encoding issue on macOS (#277)

This commit is contained in:
Tillsunset 2022-09-20 07:50:34 -05:00 committed by GitHub
parent 6fa0ac6eaa
commit 7864d76eca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 8 deletions

View File

@ -300,14 +300,14 @@ void MemorySearcherTool::Load()
bool found = false; bool found = false;
for (const auto& entry : kDataTypeNames) for (const auto& entry : kDataTypeNames)
{ {
if (boost::iequals(entry, *option_type)) if (boost::iequals(entry.ToStdString(), *option_type))
{ {
found = true; found = true;
break; break;
} }
} }
if (!found && !boost::iequals(kDatatypeString, *option_type)) if (!found && !boost::iequals(kDatatypeString.ToStdString(), *option_type))
continue; continue;
wxVector<wxVariant> data; wxVector<wxVariant> data;

View File

@ -68,7 +68,7 @@ void wxLogCtrl::PushEntry(const wxString& filter, const wxString& message)
ListIt_t it = m_log_entries.back(); ListIt_t it = m_log_entries.back();
lock.unlock(); 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); std::unique_lock active_lock(m_active_mutex);
m_active_entries.emplace_back(std::cref(it)); m_active_entries.emplace_back(std::cref(it));
@ -149,7 +149,8 @@ void wxLogCtrl::UpdateActiveEntries()
{ {
for (const auto& it : m_log_entries) 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); m_active_entries.emplace_back(it);
} }
} }

View File

@ -197,10 +197,10 @@ boost::optional<wxTitleManagerList::TitleEntry&> wxTitleManagerList::GetTitleEnt
boost::optional<const wxTitleManagerList::TitleEntry&> wxTitleManagerList::GetTitleEntry(const fs::path& path) const boost::optional<const wxTitleManagerList::TitleEntry&> wxTitleManagerList::GetTitleEntry(const fs::path& path) const
{ {
const auto tmp = path.generic_u8string(); const auto tmp = _pathToUtf8(path);
for (const auto& data : m_data) 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; return data->entry;
} }
@ -208,10 +208,10 @@ boost::optional<const wxTitleManagerList::TitleEntry&> wxTitleManagerList::GetTi
} }
boost::optional<wxTitleManagerList::TitleEntry&> wxTitleManagerList::GetTitleEntry(const fs::path& path) boost::optional<wxTitleManagerList::TitleEntry&> wxTitleManagerList::GetTitleEntry(const fs::path& path)
{ {
const auto tmp = path.generic_u8string(); const auto tmp = _pathToUtf8(path);
for (const auto& data : m_data) 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; return data->entry;
} }