2010-04-27 Danny Smith <dannysmith@users.sourceforge.net>

* mingwex/mb_wc_common.h (get_codepage): Revert change of 2006-09-19.
This commit is contained in:
Chris Sutcliffe 2010-05-19 02:59:46 +00:00
parent 8f01c77516
commit 5f7eee9ec9
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,7 @@
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.

View File

@ -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;
}