// -------------------------------------------------------------- -*- C++ -*- // File: doc/fondation/userman/src/internationalization/checkXLocale.cpp // -------------------------------------------------------------------------- // Copyright (C) 1990-2008. // All Rights Reserved. // -------------------------------------------------------------------------- #include <X11/Xlib.h> #include <X11/Xlocale.h> #include <stdlib.h> #include <stdio.h> int main(int argc, char* argv[]) { char* loc = setlocale(LC_CTYPE, “”); if (loc == NULL) { fprintf(stderr, “System does not support this locale.\n”); exit(1); } if (!XSupportsLocale()) { fprintf(stderr, “X does not support locale %s.\n”, loc); exit(1); } if (XSetLocaleModifiers(“”) == NULL) { fprintf(stderr, “Warning: cannot set locale modifiers for %s.\n”, loc); } else fprintf(stderr, “Locale %s is supported by Xlib.\n”, loc); exit(0); } |