mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
HexEditor: Add BE decoding for UTF16String column in ValueInspector
This commit is contained in:
parent
8c1a409263
commit
b87b1472e1
Notes:
sideshowbarker
2024-07-19 16:56:08 +09:00
Author: https://github.com/zimno-mi 🔰 Commit: https://github.com/SerenityOS/serenity/commit/b87b1472e14 Pull-request: https://github.com/SerenityOS/serenity/pull/17639 Reviewed-by: https://github.com/MacDue Reviewed-by: https://github.com/nico ✅
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue