From e2e88ef8aa506a1a96bf768ff7d64b57354c895f Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Wed, 20 Apr 2022 17:30:36 +0900 Subject: [PATCH] Fix shibukawa's fix of tests/events --- tests/events.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/events.c b/tests/events.c index 465b5e1b..6239464e 100644 --- a/tests/events.c +++ b/tests/events.c @@ -458,6 +458,7 @@ static void preedit_callback(GLFWwindow* window, int strLength, unsigned int* st Slot* slot = glfwGetWindowUserPointer(window); int i, blockIndex = -1, blockCount = 0; int width, height; + char encoded[5] = ""; printf("%08x to %i at %0.3f: Preedit text ", counter++, slot->number, glfwGetTime()); if (strLength == 0 || blockLength == 0) { @@ -475,7 +476,8 @@ static void preedit_callback(GLFWwindow* window, int strLength, unsigned int* st printf("["); } } - printf("%s", get_character_string(string[i])); + encode_utf8(encoded, string[i]); + printf("%s", encoded); blockCount--; } if (blockIndex == focusedBlock) {