diff options
Diffstat (limited to 'winsup/mingw/mingwex/mb_wc_common.h')
-rwxr-xr-x | winsup/mingw/mingwex/mb_wc_common.h | 18 |
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; +} |