1 /* Prints the locale's encoding via libX11. */
10 int main (int argc
, char* argv
[])
13 XTextProperty textprop
;
19 setlocale(LC_CTYPE
,"");
21 display
= XOpenDisplay(NULL
);
22 if (display
== NULL
) {
23 fprintf(stderr
,"cannot open display\n");
28 if (XmbTextListToTextProperty(display
, &input
, 1, XTextStyle
, &textprop
) != Success
) {
29 fprintf(stderr
,"XmbTextListToTextProperty failed\n");
32 assert(textprop
.format
== 8);
33 assert(textprop
.nitems
== 0);
35 printf("%s\n", XGetAtomName(display
, textprop
.encoding
));
37 XCloseDisplay(display
);