diff options
| author | Sepalani <sepalani@hotmail.fr> | 2017-04-21 01:12:22 +0100 |
|---|---|---|
| committer | Sepalani <sepalani@hotmail.fr> | 2017-04-29 20:27:51 +0100 |
| commit | f8465d08e8b49633c4368a6cf1e63f7bc09d0f0d (patch) | |
| tree | df26684e69f658049b9e5b8f03f3ae6c063ed0d5 /Source/Core/DolphinWX/Debugger/MemoryView.cpp | |
| parent | a2cba6d72f049e86460491c875353584e167d613 (diff) | |
MemoryView: Prevent non-ascii characters
Diffstat (limited to 'Source/Core/DolphinWX/Debugger/MemoryView.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Debugger/MemoryView.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/DolphinWX/Debugger/MemoryView.cpp b/Source/Core/DolphinWX/Debugger/MemoryView.cpp index 80c4efa5d7..1717ea397a 100644 --- a/Source/Core/DolphinWX/Debugger/MemoryView.cpp +++ b/Source/Core/DolphinWX/Debugger/MemoryView.cpp @@ -5,9 +5,9 @@ #include "DolphinWX/Debugger/MemoryView.h" #include <algorithm> -#include <cctype> #include <cmath> #include <cstring> +#include <locale> #include <string> #include <wx/brush.h> #include <wx/clipbrd.h> @@ -123,9 +123,9 @@ wxString CMemoryView::ReadMemoryAsString(u32 address) const str.reserve(4); for (unsigned int i = 0; i < 4; ++i) { - u8 byte = static_cast<u8>(mem_data >> (24 - i * 8)); - if (std::isprint(byte)) - str += static_cast<char>(byte); + char byte = static_cast<char>(mem_data >> (24 - i * 8) & 0xFF); + if (std::isprint(byte, std::locale::classic())) + str += byte; else str += ' '; } |
