1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 06:14:58 +00:00

KeyboardMapper: Convert Utf-8 char in String to Utf-32 code point

Ensure that the Utf-8 encoded "mapping character" in String (from
InputBox) gets converted to Utf-32 code point. Before, only the first
byte of Utf-8 char sequence was used as a Utf-32 code point.

That used to result in incorrect characters getting written in the
keymap file for all the "non-ascii" characters used as the mapping
character.
This commit is contained in:
ronak69 2024-01-23 14:42:45 +00:00 committed by Andrew Kaster
parent 227aa8f2e4
commit 90d68d43ce

View file

@ -69,7 +69,7 @@ void KeyboardMapperWidget::create_frame()
if (value.is_empty())
map[index] = '\0'; // Empty string
else
map[index] = value.bytes().at(0);
map[index] = *value.code_points().begin();
window()->set_modified(true);
}