From a3cfd0c8f4e800fe7f5d5789e9bfd29b7dd75c54 Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 15 Dec 2001 11:10:19 +0000 Subject: [PATCH] Jaeyoun Chung's mysterious patch that apparently makes Korean input work properly: call luni_send() one character at a time rather than all together after WM_IME_COMPOSITION. git-svn-id: svn://svn.tartarus.org/sgt/putty@1494 cda61777-01e9-0310-a592-d414129be87e --- window.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/window.c b/window.c index 54665c97..a8fe7ab5 100644 --- a/window.c +++ b/window.c @@ -2384,7 +2384,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, HIMC hIMC; int n; char *buff; - + if(osVersion.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS || osVersion.dwPlatformId == VER_PLATFORM_WIN32s) break; /* no Unicode */ @@ -2395,9 +2395,17 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0); if (n > 0) { + int i; buff = (char*) smalloc(n); ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buff, n); - luni_send((unsigned short *)buff, n / 2, 1); + /* + * Jaeyoun Chung reports that Korean character + * input doesn't work correctly if we do a single + * luni_send() covering the whole of buff. So + * instead we luni_send the characters one by one. + */ + for (i = 0; i < n; i += 2) + luni_send((unsigned short *)(buff+i), 1, 1); free(buff); } ImmReleaseContext(hwnd, hIMC); -- 2.11.0