diff options
author | Chris Sutcliffe <ir0nh34d@users.sourceforge.net> | 2010-05-19 06:59:46 +0400 |
---|---|---|
committer | Chris Sutcliffe <ir0nh34d@users.sourceforge.net> | 2010-05-19 06:59:46 +0400 |
commit | 5f7eee9ec93d8caf090d06aa45571940ee831565 (patch) | |
tree | b88586e088f6c0a90501cc1aed81c4d5580c6f1c /winsup/mingw/mingwex | |
parent | 8f01c775162c36a092f044a26985f17f6c218662 (diff) |
2010-04-27 Danny Smith <dannysmith@users.sourceforge.net>
* mingwex/mb_wc_common.h (get_codepage): Revert change of 2006-09-19.
Diffstat (limited to 'winsup/mingw/mingwex')
-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; } |