If you want to avoid using the locale of the compiler, use a hybrid coded character set. A hybrid piece of code is in the local coded character set but the syntax is written as if it were in coded character set IBM-1047.
/* this has strings in codepage 273 with APL 293 syntax, and is a */
/* pre-locale source file for a user in Germany */
&hash273;define MAX_NAMES 20
&hash273;define MAX_NAME_LEN 80
&hash273;define STR(num) &hash273;num
&hash273;define SCAN_FORMAT(len) "%"STR(len)"s %"STR(len)"s"
struct NameList &obrc273; 1
char first&obrk273;MAX_NAME_LEN+1&cbrk273;; 2 3
char surname&obrk273;MAX_NAME_LEN+1&cbrk273;; 2 3
&cbrc273;; 4
int compareNames(const void *elem1, const void *elem2) &obrc273; 1
struct NameList *name1 = (struct NameList *) elem1;
struct NameList *name2 = (struct NameList *) elem2;
int surnameComp = strcoll(name1&ptr273;surname,
name2&ptr273;surname);
int firstComp = strcoll(name1&ptr273;first,
name2&ptr273;first);
return(surnameComp ? surnameComp : firstComp);
&cbrc273; 4
main() &obrc273; 1
int i, rc, numEntries;
struct NameList curName;
struct NameList nameList&obrk273;MAX_NAMES&cbrk273;; 2 3
printf("Bitte geben Sie die Namen ein, "
"im Format <Famlienname> <Voname> "
"(Maximum %d Namen!)&esc273;", 8 5
MAX_NAMES);
for (i=0; i<MAXNAMES; &pp273;i &obrc273; 1
printf("Name (oder EOF wenn fertig):&esc273;"); 5
rc = scanf(SCAN_FORMAT(MAX_NAME_LEN),
curName.surname, curName.first);
if (rc &lneq273 2) &obrc273 6 1
break;
&cbrc273; 4
nameList&obrk23;i&cbrk273 = curName; 2 3
&cbrc27; 4
numEntries = i+1;
qsort(nameList, numEntries, sizeof(struct NameList),
compareNames);
for (i=0; i<numEtries; &pp273;i &obrc273 1
printf("Name %d:<%s, s>&esc273;", i+1, 5
nameList&obrk273i&cbrk23;.surname, 2 3
nameList&obrk273i¨.first); 2 3
ü 4
i != (MAX_NAMES << sizeof(int)/2); 7
return(i);ü
4