Index: windows/windefs.c
===================================================================
--- windows/windefs.c	(revision 5491)
+++ windows/windefs.c	(working copy)
@@ -10,10 +10,10 @@
 {
     FontSpec ret;
     if (!strcmp(name, "Font")) {
-	strcpy(ret.name, "Courier New");
+	strcpy(ret.name, "ü");
 	ret.isbold = 0;
-	ret.charset = ANSI_CHARSET;
-	ret.height = 10;
+	ret.charset = HANGEUL_CHARSET;
+	ret.height = 11;
     } else {
 	ret.name[0] = '\0';
     }
Index: windows/window.c
===================================================================
--- windows/window.c	(revision 5491)
+++ windows/window.c	(working copy)
@@ -183,6 +183,9 @@
 
 static UINT wm_mousewheel = WM_MOUSEWHEEL;
 
+int iic = 0;
+TCHAR iic_buf[2];
+
 /* Dummy routine, only required in plink. */
 void ldisc_update(void *frontend, int echo, int edit)
 {
@@ -2746,14 +2749,27 @@
 	set_input_locale((HKL)lParam);
 	sys_cursor_update();
 	break;
-      case WM_IME_NOTIFY:
-	if(wParam == IMN_SETOPENSTATUS) {
+      case WM_IME_STARTCOMPOSITION:
+        {
 	    HIMC hImc = ImmGetContext(hwnd);
-	    ImmSetCompositionFont(hImc, &lfont);
+	    COMPOSITIONFORM cf;
+	    RECT rectWorkArea;
+	    SystemParametersInfo(SPI_GETWORKAREA,
+				   0,
+				   (void*)&rectWorkArea,
+				   0);
+
+	    cf.dwStyle = CFS_POINT;
+	    cf.ptCurrentPos.x = 0; // drive out of screen
+	    cf.ptCurrentPos.y = rectWorkArea.bottom+50;
+	    ImmSetCompositionWindow(hImc, &cf);
 	    ImmReleaseContext(hwnd, hImc);
 	    return 0;
 	}
 	break;
+      case WM_IME_ENDCOMPOSITION:
+        iic = 0;
+        break;
       case WM_IME_COMPOSITION:
 	{
 	    HIMC hIMC;
@@ -2761,11 +2777,26 @@
 	    char *buff;
 
 	    if(osVersion.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS || 
-	        osVersion.dwPlatformId == VER_PLATFORM_WIN32s) break; /* no Unicode */
+	        osVersion.dwPlatformId == VER_PLATFORM_WIN32s) {
+	        break; /* no Unicode */
+	    }
 
-	    if ((lParam & GCS_RESULTSTR) == 0) /* Composition unfinished. */
+	    if ((lParam & GCS_RESULTSTR) == 0) {/* Composition unfinished. */
+		RECT invrect;
+		
+		iic_buf[0] = wParam >> 8;
+		iic_buf[1] = wParam;
+		iic = 2;
+		invrect.left = caret_x;
+		invrect.top  = caret_y;
+		invrect.right = caret_x + font_width*2;
+		invrect.bottom = caret_y + font_height;
+		InvalidateRect(hwnd, &invrect, TRUE);
 		break; /* fall back to DefWindowProc */
+	    }
 
+	    iic = 0;
+
 	    hIMC = ImmGetContext(hwnd);
 	    n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0);
 
@@ -2923,8 +2954,10 @@
 
 static void sys_cursor_update(void)
 {
+#if 0
     COMPOSITIONFORM cf;
     HIMC hIMC;
+#endif
 
     if (!term->has_focus) return;
 
@@ -2939,6 +2972,7 @@
     if(osVersion.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS &&
 	    osVersion.dwMinorVersion == 0) return; /* 95 */
 
+#if 0
     /* we should have the IMM functions */
     hIMC = ImmGetContext(hwnd);
     cf.dwStyle = CFS_POINT;
@@ -2947,6 +2981,7 @@
     ImmSetCompositionWindow(hIMC, &cf);
 
     ImmReleaseContext(hwnd, hIMC);
+#endif
 }
 
 /*
@@ -4115,6 +4150,9 @@
 	    for (i=0; i<3; i++) keys[i] = keybs[i];
 	} else {
 	    r = ToAsciiEx(wParam, scan, keystate, keys, 0, kbd_layout);
+	    /* Workaround for Hangul Windows 98 */
+	    if (r == 0 && keys[0] == '\0')
+		r = ToAscii(wParam, scan, keystate, keys, 0);
 	}
 #ifdef SHOW_TOASCII_RESULT
 	if (r == 1 && !key_down) {
Index: windows/winucs.c
===================================================================
--- windows/winucs.c	(revision 5491)
+++ windows/winucs.c	(working copy)
@@ -12,6 +12,8 @@
  * the xterm one has the four scanlines that have no unicode 2.0
  * equivalents mapped to their unicode 3.0 locations.
  */
+static char **uni_tbl = NULL;
+
 static const WCHAR unitab_xterm_std[32] = {
     0x2666, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1,
     0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0x23ba,
@@ -428,6 +430,9 @@
     {"CP620 (Mazovia)", 0, 128, mazovia},
     {"CP819", 28591},
     {"CP878", 20866},
+    {"CP932", 932},
+    {"CP949", 949},
+    {"CP950", 950},
 
     {"Use font encoding", -1},
 
@@ -1108,7 +1113,7 @@
 	    if (GetCPInfo(codepage, &cpinfo) == 0) {
 		codepage = -2;
 	    } else if (cpinfo.MaxCharSize > 1)
-		codepage = -3;
+		/*codepage = -3*/;
 	}
     }
     if (codepage == -1 && *cp_name)
Index: settings.c
===================================================================
--- settings.c	(revision 5491)
+++ settings.c	(working copy)
@@ -664,7 +664,7 @@
      * The empty default for LineCodePage will be converted later
      * into a plausible default for the locale.
      */
-    gpps(sesskey, "LineCodePage", "", cfg->line_codepage,
+    gpps(sesskey, "LineCodePage", "CP949", cfg->line_codepage,
 	 sizeof(cfg->line_codepage));
     gppi(sesskey, "UTF8Override", 1, &cfg->utf8_override);
     gpps(sesskey, "Printer", "", cfg->printer, sizeof(cfg->printer));
Index: terminal.c
===================================================================
--- terminal.c	(revision 5491)
+++ terminal.c	(working copy)
@@ -66,6 +66,9 @@
 #define sel_nl_sz  (sizeof(sel_nl)/sizeof(wchar_t))
 const wchar_t sel_nl[] = SEL_NL;
 
+extern int iic;
+extern TCHAR iic_buf[2];
+
 /*
  * Fetch the character at a particular position in a line array,
  * for purposes of `wordtype'. The reason this isn't just a simple
@@ -4666,6 +4669,7 @@
 	int last_run_dirty = 0;
 	int laststart, dirtyrect;
 	int *backward;
+	int cursor_wide = 0;
 
 	scrpos.y = i + term->disptop;
 	ldata = lineptr(scrpos.y);
@@ -4757,6 +4761,17 @@
 		term->curstype = cursor;
 		term->dispcursx = j;
 		term->dispcursy = i;
+		if ((unsigned char)tchar > 0x80)
+		    cursor_wide = 1;
+		if (iic) {
+		    tchar = tchar & 0xffffff00 | (unsigned char)iic_buf[0];
+		    tattr |= ATTR_INVALID;
+		}
+	    } else if ((cursor_wide || iic) && i == our_curs_y && j == our_curs_x+1) {
+	    	tattr |= cursor;
+		term->curstype = cursor;
+		if (iic)
+		    tchar = tchar & 0xffffff00 | (unsigned char)iic_buf[1];
 	    }
 
 	    /* FULL-TERMCHAR */
@@ -4818,6 +4833,9 @@
 	    tattr = newline[j].attr;
 	    tchar = newline[j].chr;
 
+	    if (i == our_curs_y && j == our_curs_x+1 && iic)
+		tattr = newline[j].attr = attr;
+
 	    if ((term->disptext[i]->chars[j].attr ^ tattr) & ATTR_WIDE)
 		dirty_line = TRUE;
 
