MemoryView: Prevent non-ascii characters
This commit is contained in:
parent
a2cba6d72f
commit
f8465d08e8
|
@ -5,9 +5,9 @@
|
||||||
#include "DolphinWX/Debugger/MemoryView.h"
|
#include "DolphinWX/Debugger/MemoryView.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cctype>
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <locale>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <wx/brush.h>
|
#include <wx/brush.h>
|
||||||
#include <wx/clipbrd.h>
|
#include <wx/clipbrd.h>
|
||||||
|
@ -123,9 +123,9 @@ wxString CMemoryView::ReadMemoryAsString(u32 address) const
|
||||||
str.reserve(4);
|
str.reserve(4);
|
||||||
for (unsigned int i = 0; i < 4; ++i)
|
for (unsigned int i = 0; i < 4; ++i)
|
||||||
{
|
{
|
||||||
u8 byte = static_cast<u8>(mem_data >> (24 - i * 8));
|
char byte = static_cast<char>(mem_data >> (24 - i * 8) & 0xFF);
|
||||||
if (std::isprint(byte))
|
if (std::isprint(byte, std::locale::classic()))
|
||||||
str += static_cast<char>(byte);
|
str += byte;
|
||||||
else
|
else
|
||||||
str += ' ';
|
str += ' ';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue