1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:27:45 +00:00

HexEditor: Add UTF8 to the value inspector

This commit is contained in:
kleines Filmröllchen 2022-04-12 19:00:36 +02:00 committed by Linus Groh
parent e5736cdf2f
commit ef113b2f91
2 changed files with 19 additions and 1 deletions

View file

@ -27,6 +27,7 @@ public:
Float,
Double,
ASCII,
UTF8,
__Count
};
@ -93,6 +94,8 @@ public:
return "Double";
case ASCII:
return "ASCII";
case UTF8:
return "UTF-8";
default:
return "";
}
@ -128,6 +131,12 @@ public:
case UnsignedLong:
case Double:
return 8;
case UTF8: {
auto utf8_view = Utf8View(m_values.at(index.row()));
if (utf8_view.validate())
return static_cast<i32>(utf8_view.byte_length());
return 0;
}
default:
return 0;
}