fix: Data inspector causing crashes when failing to decode UTF-16 chars
This commit is contained in:
parent
a8ed57bd65
commit
8657cf26de
@ -109,7 +109,7 @@ namespace hex::plugin::builtin {
|
||||
ContentRegistry::DataInspector::add("hex.builtin.inspector.wide", sizeof(wchar_t), [](auto buffer, auto endian, auto style) {
|
||||
auto c = hex::changeEndianess(*reinterpret_cast<wchar_t*>(buffer.data()), endian);
|
||||
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter("Invalid");
|
||||
|
||||
auto value = hex::format("'{0}'", c <= 255 ? makePrintable(c) : converter.to_bytes(c));
|
||||
return [value] { ImGui::TextUnformatted(value.c_str()); return value; };
|
||||
|
Loading…
x
Reference in New Issue
Block a user