1 /* getcp.c - Copyright (C) 2010 Pat Thoyts <patthoyts@users.sourceforge.net>
3 * Get the current OEM or ANSI code-page.
5 * This utility prints the current ANSI or OEM code-page id without any
6 * dependence on the current locate. Windows provides the 'chcp' command
7 * which prints the code page when called without any arguments, but the
8 * output is dependent on the current language which complicates parsing.
10 * Usage: getcp ?-ansi | -oem?
15 #define WIN32_LEAN_AND_MEAN
21 main(int argc
, char *argv
[])
24 if (argc
> 1 && strncmp(argv
[1], "-oem", 4) == 0) {