From 5f025bcbcc5a689bb8925f967ae45612bbf2b201 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 22 Nov 2020 16:22:23 +0100 Subject: [PATCH] Fixed UTF-8 decoding to not work --- source/views/view_data_inspector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/views/view_data_inspector.cpp b/source/views/view_data_inspector.cpp index ea802f343..664aaa5e3 100644 --- a/source/views/view_data_inspector.cpp +++ b/source/views/view_data_inspector.cpp @@ -56,11 +56,11 @@ namespace hex { char buffer[5] = { 0 }; char codepointString[5] = { 0 }; u32 codepoint = 0; - u8 codepointSize = ImTextCharFromUtf8(&codepoint, buffer, buffer + 4); std::memcpy(buffer, &this->m_previewData.utf8Char, 4); - std::memcpy(codepointString, &codepoint, std::min(codepointSize, u8(4))); + u8 codepointSize = ImTextCharFromUtf8(&codepoint, buffer, buffer + 4); + std::memcpy(codepointString, &codepoint, std::min(codepointSize, u8(4))); this->m_cachedData.emplace_back("UTF-8 code point", hex::format("'%s' (U+%04lx)", codepoint == 0xFFFD ? "Invalid" : codepointString, codepoint)); }