Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/mingw/mingwex/mb_wc_common.h')
-rwxr-xr-xwinsup/mingw/mingwex/mb_wc_common.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/mb_wc_common.h b/winsup/mingw/mingwex/mb_wc_common.h
new file mode 100755
index 000000000..a4ea81cf2
--- /dev/null
+++ b/winsup/mingw/mingwex/mb_wc_common.h
@@ -0,0 +1,18 @@
+#include <locale.h>
+#include <string.h>
+#include <stdlib.h>
+
+static inline
+unsigned int get_cp_from_locale (void)
+{
+ char* cp_string;
+ /*
+ locale :: "lang[_country[.code_page]]"
+ | ".code_page"
+
+ */
+
+ if ((cp_string = strchr(setlocale(LC_CTYPE, NULL), '.')))
+ return ((unsigned) atoi (cp_string + 1));
+ return 0;
+}