Example: Select a Locale Using Environment Variables

Here is a C program that uses environment variables to select a locale. This program runs as described if you first create the TEXAN locale following the example for the steps to customize a locale.

#include <locale.h>
#include <stdio.h>
#include <stdlib.h>

int main(void){
 printf("Default locale = \"%s\"\n", setlocale(LC_ALL,""));
 return(0);
}

If LC_ALL has the value "TEXAN", then the output will be:

Default locale = "TEXAN"

Example: Customize an Existing Locale



Internationalization
Localization and Locales


Make Your Program International
Select a Locale
Customize a Locale


Locale-Sensitive Interfaces