/* * gcc -o wmname wmname.c -lX11 -R/usr/openwin/lib/locale/common/ /usr/openwin/lib/locale/common/xiiimp.so.2 */ #include #include #include #include #include struct XIMArg { char *name; char *value; }; void dump_result(int unconv, XTextProperty *prop) { if (unconv < 0) { printf("conversion error from XmbTextListToTextProperty: %d\n", unconv); return; } printf("%d characters not converted\n", unconv); if (prop->nitems > 0) { printf("converted text: %s\n", prop->value); } else { printf("no converted text!\n"); } } int main(int argc, char **argv) { Display *dpy; char *text; XTextProperty prop; int unconv; struct XIMArg args[1]; setlocale(LC_ALL, ""); dpy = XOpenDisplay(NULL); text = "Umbruch einfügen"; unconv = XmbTextListToTextProperty(dpy, &text, 1, XStdICCTextStyle, &prop); dump_result(unconv, &prop); args[0].name = args[0].value = NULL; __XOpenIM(dpy, NULL, NULL, NULL, &args); text = "Umbruch einfügen"; unconv = XmbTextListToTextProperty(dpy, &text, 1, XStdICCTextStyle, &prop); dump_result(unconv, &prop); }