Fix shibukawa's fix of tests/events

This commit is contained in:
Daijiro Fukuda 2022-04-20 17:30:36 +09:00
parent 3386299e1f
commit e2e88ef8aa

View File

@ -458,6 +458,7 @@ static void preedit_callback(GLFWwindow* window, int strLength, unsigned int* st
Slot* slot = glfwGetWindowUserPointer(window); Slot* slot = glfwGetWindowUserPointer(window);
int i, blockIndex = -1, blockCount = 0; int i, blockIndex = -1, blockCount = 0;
int width, height; int width, height;
char encoded[5] = "";
printf("%08x to %i at %0.3f: Preedit text ", printf("%08x to %i at %0.3f: Preedit text ",
counter++, slot->number, glfwGetTime()); counter++, slot->number, glfwGetTime());
if (strLength == 0 || blockLength == 0) { if (strLength == 0 || blockLength == 0) {
@ -475,7 +476,8 @@ static void preedit_callback(GLFWwindow* window, int strLength, unsigned int* st
printf("["); printf("[");
} }
} }
printf("%s", get_character_string(string[i])); encode_utf8(encoded, string[i]);
printf("%s", encoded);
blockCount--; blockCount--;
} }
if (blockIndex == focusedBlock) { if (blockIndex == focusedBlock) {