/************************************************************************ * * * Copyright Digital Equipment Corporation 1998. All rights reserved. * * * * Restricted Rights: Use, duplication, or disclosure by the U.S. * * Government is subject to restrictions as set forth in subparagraph * * (c) (1) (ii) of DFARS 252.227-7013, or in FAR 52.227-19, or in FAR * * 52.227-14 Alt. III, as applicable. * * * * This software is proprietary to and embodies the confidential * * technology of Digital Equipment Corporation. Possession, use, or * * copying of this software and media is authorized only pursuant to a * * valid written license from Digital or an authorized sublicensor. * * * ************************************************************************/ /* setlocale_example.c */ #include #include #include /* This program calls setlocale() three times. The second call */ /* is for a nonexistent locale. The third call is for an */ /* existing file that is not a locale file. */ main() { char *ret_str; errno = 0; printf("setlocale (LC_ALL, \"POSIX\")"); ret_str = (char *) setlocale(LC_ALL, "POSIX"); if (ret_str == NULL) perror("setlocale error"); else printf(" call was succesfull\n"); errno = 0; printf("\n\nsetlocale (LC_ALL, \"junk.junk_codeset\")"); ret_str = (char *) setlocale(LC_ALL, "junk.junk_codeset"); if (ret_str == NULL) perror(" returned error"); else printf(" call was succesfull\n"); errno = 0; printf("\n\nsetlocale (LC_ALL, \"sys$login:login.com\")"); ret_str = (char *) setlocale(LC_ALL, "sys$login:login.com"); if (ret_str == NULL) perror(" returned error"); else printf(" call was succesfull\n"); }