From 90d68d43cee691a9a2a9b399f71f7e512e1e380f Mon Sep 17 00:00:00 2001 From: ronak69 Date: Tue, 23 Jan 2024 14:42:45 +0000 Subject: [PATCH] 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. --- Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp index 4777f4e4af2..04e0063cdc1 100644 --- a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp +++ b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp @@ -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); }