4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-11 19:49:15 +08:00

19 lines
336 B
C
Raw Normal View History

#include <locale.h>
#include <string.h>
#include <stdlib.h>
static inline
unsigned int get_codepage (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;
}