// -------------------------------------------------------------- -*- C++ -*- // File: doc/fondation/userman/src/internationalization/checkUnixLocale.cpp // -------------------------------------------------------------------------- // Copyright (C) 1990-2008 by ILOG. // All Rights Reserved. // -------------------------------------------------------------------------- #include <locale.h> #include <stdio.h> #include <langinfo.h> #if defined(linux) && !defined(CODESET) #define CODESET _NL_CTYPE_CODESET_NAME #endif /* linux */ int main() { char* loc = setlocale(LC_ALL, ""); if (loc) { printf("default locale: %s\n",loc); printf("encoding %s\n", nl_langinfo(CODESET)); } else printf("System does not support this locale\n"); return 0; } |
// -------------------------------------------------------------- -*- C++ -*- // File: doc/foundation/userman/src/internationalization/checkWindowsLocale.cpp // -------------------------------------------------------------------------- // Copyright (C) 1990-2008 by ILOG. // All Rights Reserved. // -------------------------------------------------------------------------- #include <locale.h> #include <stdio.h> #include <windows.h> int main(int argc, char* argv[]) { printf("default locale: %s\n", setlocale(LC_ALL, "")); printf("encoding %d\n", GetACP()); return 0; } |