diff -Nuar gtk+2.1.3/modules/input/gtkimcontextxim.c gtk+2.1.3-thximsum/modules/input/gtkimcontextxim.c
--- gtk+2.1.3/modules/input/gtkimcontextxim.c	2002-12-25 16:46:38.000000000 +0700
+++ gtk+2.1.3-thximsum/modules/input/gtkimcontextxim.c	2002-12-31 10:33:33.000000000 +0700
@@ -1028,6 +1028,86 @@
     }
 }
 
+static void
+string_conversion_callback(XIC xic, XPointer client_data, XPointer call_data)
+{
+  GtkIMContextXIM *context_xim;
+  XIMStringConversionCallbackStruct *conv_data;
+  gchar *surrounding;
+  gint  cursor_index;
+
+  context_xim = (GtkIMContextXIM *)client_data;
+  conv_data = (XIMStringConversionCallbackStruct *)call_data;
+
+  if (gtk_im_context_get_surrounding ((GtkIMContext *)context_xim,
+                                      &surrounding, &cursor_index))
+    {
+      gchar *text = NULL;
+      gsize text_len = 0;
+      gint  subst_offset = 0, subst_nchars = 0;
+      gint  i;
+      gchar *p = surrounding + cursor_index, *q;
+
+      switch (conv_data->direction)
+        {
+        case XIMForwardChar:
+          for (i = conv_data->position; i > 0 && *p; --i)
+            p = g_utf8_next_char (p);
+          if (i > 0) break;
+          for (i = conv_data->factor, q = p; i > 0 && *q; --i)
+            q = g_utf8_next_char (q);
+          if (i > 0) break;
+          text = g_locale_from_utf8 (p, q - p, NULL, &text_len, NULL);
+          subst_offset = conv_data->position;
+          subst_nchars = conv_data->factor;
+          break;
+        case XIMBackwardChar:
+          for (i = conv_data->position; i > 0 && p > surrounding; --i)
+            p = g_utf8_prev_char (p);
+          if (i > 0) break;
+          for (i = conv_data->factor, q = p; i > 0 && *q; --i)
+            q = g_utf8_next_char (q);
+          text = g_locale_from_utf8 (p, q - p, NULL, &text_len, NULL);
+          subst_offset = -conv_data->position;
+          subst_nchars = conv_data->factor;
+          break;
+        case XIMForwardWord:
+        case XIMBackwardWord:
+        case XIMCaretUp:
+        case XIMCaretDown:
+        case XIMNextLine:
+        case XIMPreviousLine:
+        case XIMLineStart:
+        case XIMLineEnd:
+        case XIMAbsolutePosition:
+        case XIMDontChange:
+        default:
+          break;
+        }
+      if (text)
+        {
+          conv_data->text = (XIMStringConversionText *)
+                              malloc (sizeof (XIMStringConversionText));
+          conv_data->text->length = text_len;
+          conv_data->text->feedback = NULL;
+          conv_data->text->encoding_is_wchar = False;
+          conv_data->text->string.mbs = (char *)malloc (text_len);
+          memcpy (conv_data->text->string.mbs, text, text_len);
+
+          g_free (text);
+        }
+      if (conv_data->operation == XIMStringConversionSubstitution
+          && subst_nchars > 0)
+        {
+          gtk_im_context_delete_surrounding((GtkIMContext *)context_xim,
+                                            subst_offset, subst_nchars);
+        }
+
+      g_free(surrounding);
+    }
+}
+
+
 static XVaNestedList
 set_preedit_callback (GtkIMContextXIM *context_xim)
 {
@@ -1064,6 +1144,18 @@
 			      NULL);
 }
 
+static void
+set_string_conversion_callback (GtkIMContextXIM *context_xim, XIC xic)
+{
+  context_xim->string_conversion_callback.client_data = (XPointer)context_xim;
+  context_xim->string_conversion_callback.callback
+    = (XICProc)string_conversion_callback;
+
+  XSetICValues (xic,
+                XNStringConversionCallback,
+                (XPointer)&context_xim->string_conversion_callback, NULL);
+}
+
 static XIC
 get_ic_real (GtkIMContextXIM *context_xim)
 {
@@ -1128,6 +1220,7 @@
 		    XNFilterEvents, &mask,
 		    NULL);
       context_xim->filter_key_release = (mask & KeyReleaseMask);
+      set_string_conversion_callback (context_xim, xic);
     }
 
   return xic;
diff -Nuar gtk+2.1.3/modules/input/gtkimcontextxim.h gtk+2.1.3-thximsum/modules/input/gtkimcontextxim.h
--- gtk+2.1.3/modules/input/gtkimcontextxim.h	2002-12-25 16:47:39.000000000 +0700
+++ gtk+2.1.3-thximsum/modules/input/gtkimcontextxim.h	2002-12-25 16:57:23.000000000 +0700
@@ -73,6 +73,8 @@
   XIC ic;
   gboolean filter_key_release;
 
+  XICCallback string_conversion_callback;
+
   guint use_preedit : 1;
   guint status_visible : 1;
 };
diff -Nuar gtk+2.1.3/modules/input/imxim.c gtk+2.1.3-thximsum/modules/input/imxim.c
--- gtk+2.1.3/modules/input/imxim.c	2002-12-25 16:57:37.000000000 +0700
+++ gtk+2.1.3-thximsum/modules/input/imxim.c	2002-12-25 16:56:57.000000000 +0700
@@ -27,7 +27,7 @@
   N_("X Input Method"),            /* Human readable name */
   "gtk+",			   /* Translation domain */
    GTK_LOCALEDIR,		   /* Dir for bindtextdomain (not strictly needed for "gtk+") */
-  "ko:ja:zh"		           /* Languages for which this module is the default */
+  "ko:ja:th:zh"		           /* Languages for which this module is the default */
 };
 
 static const GtkIMContextInfo *info_list[] = {
