diff --git a/Source/Core/DolphinQt2/Debugger/MemoryWidget.cpp b/Source/Core/DolphinQt2/Debugger/MemoryWidget.cpp index ce65088126..20e5df04ac 100644 --- a/Source/Core/DolphinQt2/Debugger/MemoryWidget.cpp +++ b/Source/Core/DolphinQt2/Debugger/MemoryWidget.cpp @@ -385,9 +385,9 @@ void MemoryWidget::OnSetValue() if (m_find_ascii->isChecked()) { - std::string ascii = m_data_edit->text().toStdString(); + const QByteArray bytes = m_data_edit->text().toUtf8(); - for (char c : ascii) + for (char c : bytes) PowerPC::HostWrite_U8(static_cast(c), addr++); } else @@ -471,10 +471,8 @@ std::vector MemoryWidget::GetValueData() const if (m_find_ascii->isChecked()) { - std::string s = m_data_edit->text().toStdString(); - - for (char c : s) - search_for.push_back(c); + const QByteArray bytes = m_data_edit->text().toUtf8(); + search_for.assign(bytes.begin(), bytes.end()); } else {