fix: New lines in wide string messing up data inspector drawing

This commit is contained in:
WerWolv 2022-10-10 14:41:24 +02:00
parent c6d2d51d4c
commit 7474aa3e5d
1 changed files with 2 additions and 1 deletions

View File

@ -450,7 +450,8 @@ namespace hex::plugin::builtin {
[](auto c) { return c == 0x00; });
buffer.erase(it, buffer.end());
value = copyValue = std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t>("Invalid").to_bytes(stringBuffer.data());
auto string = std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t>("Invalid").to_bytes(stringBuffer.data());
value = copyValue = hex::encodeByteString({ string.begin(), string.end() });
if (value.size() > MaxStringLength) {
value.resize(MaxStringLength);