Files
RedBear-OS/recipes/libs/libiconv/source/libcharset/tools/locale_x11encoding.c
T
vasilito ff4ff35918 feat: track all source trees in git — full fork offline-first model
Red Bear OS is a full fork. All sources must be available from git clone
with zero network access. Removed gitignore rules that excluded fetched
source trees under recipes/*/source/, local/recipes/kde/*/source/,
local/recipes/qt/*/source/, and vendor source trees.

Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded.

127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt
frameworks, mesa, wayland, DRM drivers, and every other recipe source.
2026-05-14 10:55:53 +01:00

41 lines
793 B
C

/* 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);
}