mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-12-15 08:30:11 +08:00
31 lines
640 B
C
31 lines
640 B
C
|
#include <stdlib.h>
|
||
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
#include <assert.h>
|
||
|
#include <locale.h>
|
||
|
#include <windows.h>
|
||
|
|
||
|
int
|
||
|
main(int argc, char** argv)
|
||
|
{
|
||
|
int acp = -1;
|
||
|
const char* acpid = NULL;
|
||
|
const char* lcall = NULL;
|
||
|
const char* lcctype = NULL;
|
||
|
char digits[16];
|
||
|
|
||
|
switch (acp = GetACP()) {
|
||
|
case 1252: acpid = "CP_1252"; break;
|
||
|
case 65001: acpid = "CP_UTF8"; break;
|
||
|
default:
|
||
|
snprintf(digits,sizeof(digits),"%d",acp);
|
||
|
acpid = digits;
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
lcall = setlocale(LC_ALL,NULL);
|
||
|
lcctype = setlocale(LC_CTYPE,NULL);
|
||
|
printf("ACP=%s locale: LC_ALL=%s LC_CTYPE=%s\n",acpid,lcall,lcctype);
|
||
|
return 0;
|
||
|
}
|