* mingwex/mb_wc_common.h (get_codepage): Revert change of 2006-09-19.
+2010-04-27 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * mingwex/mb_wc_common.h (get_codepage): Revert change of 2006-09-19.
+
2010-03-06 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/_mingw.h: Increment version to 3.18.
-__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;
}