diff options
author | Patryk Pilipczuk <idziezima@proton.me> | 2023-02-26 19:45:53 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-02-27 13:39:40 +0100 |
commit | b87b1472e14816db5d6539351de8a4e2c0b166f6 (patch) | |
tree | 4c8d8640b32a444d947d17e5f74d9ec58b9e5719 /Userland | |
parent | 8c1a409263996cfb573dd2235468297211fcea67 (diff) | |
download | serenity-b87b1472e14816db5d6539351de8a4e2c0b166f6.zip |
HexEditor: Add BE decoding for UTF16String column in ValueInspector
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Applications/HexEditor/HexEditorWidget.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Applications/HexEditor/HexEditorWidget.cpp b/Userland/Applications/HexEditor/HexEditorWidget.cpp index 2869195bc4..4d4ef49bd1 100644 --- a/Userland/Applications/HexEditor/HexEditorWidget.cpp +++ b/Userland/Applications/HexEditor/HexEditorWidget.cpp @@ -392,7 +392,9 @@ void HexEditorWidget::update_inspector_values(size_t position) // FIXME: Parse as other values like Timestamp etc - DeprecatedString utf16_string = TextCodec::decoder_for("utf-16le"sv)->to_utf8(StringView(selected_bytes.span())).release_value_but_fixme_should_propagate_errors().to_deprecated_string(); + auto decoder = TextCodec::decoder_for(m_value_inspector_little_endian ? "utf-16le"sv : "utf-16be"sv); + DeprecatedString utf16_string = decoder->to_utf8(StringView(selected_bytes.span())).release_value_but_fixme_should_propagate_errors().to_deprecated_string(); + value_inspector_model->set_parsed_value(ValueInspectorModel::ValueType::UTF16String, utf16_string); m_value_inspector->set_model(value_inspector_model); |