diff options
Diffstat (limited to 'winsup/mingw/mingwex/mb_wc_common.h')
-rwxr-xr-x | winsup/mingw/mingwex/mb_wc_common.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/winsup/mingw/mingwex/mb_wc_common.h b/winsup/mingw/mingwex/mb_wc_common.h index 40028d682..d1c2f9d10 100755 --- a/winsup/mingw/mingwex/mb_wc_common.h +++ b/winsup/mingw/mingwex/mb_wc_common.h @@ -1,7 +1,13 @@ -__declspec(dllimport) unsigned int __lc_codepage; +#include <locale.h> +#include <string.h> +#include <stdlib.h> static inline unsigned int get_codepage (void) { - return __lc_codepage; + /* locale :: "lang[_country[.code_page]]" | ".code_page" */ + char * cp_string; + if ((cp_string = strchr (setlocale(LC_CTYPE, NULL), '.'))) + return ((unsigned) atoi (cp_string + 1)); + return 0; } |