#include #include #include #include int main (int argc, char *argv[]) { Display *display; const char *text = "√"; XTextProperty tp; int ret; int j; setlocale (LC_ALL, ""); display = XOpenDisplay (NULL); tp.value = 0; ret = Xutf8TextListToTextProperty (display, (char **)&(text), 1, XCompoundTextStyle, &tp); if (tp.value) { printf ("ret:%d value: ", ret); for (j = 0; tp.value[j]; j++) printf ("%x ", tp.value[j]); printf ("\n"); } else { printf ("ret:%d value:0\n", ret); } return 0; }