Sha256: fb2e866d000551356bd181fa6bab9bb2f597f10bd136d2b949804bcda965922d

Contents?: true

Size: 793 Bytes

Versions: 5

Compression:

Stored size: 793 Bytes

Contents

/* Prints the locale's encoding via libX11. */

#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <locale.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>

int main (int argc, char* argv[])
{
  Display* display;
  XTextProperty textprop;
  char* input;

  if (argc != 1)
    exit(1);

  setlocale(LC_CTYPE,"");

  display = XOpenDisplay(NULL);
  if (display == NULL) {
    fprintf(stderr,"cannot open display\n");
    exit(1);
  }

  input = "";
  if (XmbTextListToTextProperty(display, &input, 1, XTextStyle, &textprop) != Success) {
    fprintf(stderr,"XmbTextListToTextProperty failed\n");
    exit(1);
  }
  assert(textprop.format == 8);
  assert(textprop.nitems == 0);

  printf("%s\n", XGetAtomName(display, textprop.encoding));

  XCloseDisplay(display);

  exit(0);
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
controller_scaffolding-1.0.3 test/dummy/libiconv-1.13.1/libcharset/tools/locale_x11encoding.c
controller_scaffolding-1.0.2 test/dummy/libiconv-1.13.1/libcharset/tools/locale_x11encoding.c
controller_scaffolding-1.0.1 test/dummy/libiconv-1.13.1/libcharset/tools/locale_x11encoding.c
controller_scaffolding-1.0.0 test/dummy/libiconv-1.13.1/libcharset/tools/locale_x11encoding.c
controller_scaffolding-0.1.5 test/dummy/libiconv-1.13.1/libcharset/tools/locale_x11encoding.c