Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mb_wc_common.h « mingwex « mingw « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d1c2f9d10ed18d1e9f294586fd231137fc321ed4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <locale.h>
#include <string.h>
#include <stdlib.h>

static inline
unsigned int get_codepage (void)
{
  /* 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;
}