Permalink
Browse files

misc/codeset: add a tool for checking codeset of a particular locale

  • Loading branch information...
grawity committed Jan 26, 2014
1 parent 9cdc009 commit daeb7a04113d82c201e31c01dd7ac32e4b71608c
Showing with 16 additions and 0 deletions.
  1. +1 −0 Makefile
  2. +15 −0 misc/codeset.c
View
@@ -155,6 +155,7 @@ $(OBJ)/ac-wait: LDLIBS += -ludev
$(OBJ)/ac-wait: system/ac-wait.c
$(OBJ)/args: misc/args.c
$(OBJ)/bgrep: thirdparty/bgrep.c
+$(OBJ)/codeset: misc/codeset.c
$(OBJ)/globalenv: LDLIBS += -lkeyutils
$(OBJ)/globalenv: system/globalenv.c $(OBJ)/misc_util.o
$(OBJ)/k5userok: LDLIBS += $(KRB_LDLIBS)
View
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <locale.h>
+#include <langinfo.h>
+
+int main(int argc, char *argv[]) {
+ while (*++argv)
+ putenv(*argv);
+
+ setlocale(LC_ALL, "");
+
+ printf("%s\n", nl_langinfo(CODESET));
+
+ return 0;
+}

0 comments on commit daeb7a0

Please sign in to comment.