With the default_charset string literal, any characters can be set as a valid string literal. For example, if the LANG environment variable is el_GR, the string literal with default_charset can contain any Greek character. If the LANG environment variable is ja_JP, the default_charset string literal can contain any Japanese character encoded in Japanese EUC.
If no character set is set to a string literal, the character set of the string literal is set as cur_charset. And, in the system environment, the cur_charset value is always set as default_charset.
Figure 4-4 shows a UIL sample program on English and Japanese environments.
In the following sample program, LLL indicates locale text, which can be Japanese, Korean, Traditional Chinese, Greek, French, or others.
uil_sample.uil ! ! sample uil file - uil_sample.uil ! ! C source file - uil_sample.c ! ! Resource file - uil-sample.resource ! module Test version = 'v1.0' names = case_sensitive objects = { XmPushButton = gadget; } !************************************ ! declare callback procedure !************************************ procedure exit_CB ; !*************************************************************** ! declare BulletinBoard as parent of PushButton and Text !*************************************************************** object bb : XmBulletinBoard { arguments{ XmNwidth = 500; XmNheight = 200; }; controls{ XmPushButton pb1; XmText text1; }; }; !**************************** ! declare PushButton !**************************** object pb1 : XmPushButton { arguments{ XmNlabelString = #Normal "LLLexit buttonLLL"; XmNx = 50; XmNy = 50; }; callbacks{ XmNactivateCallback = procedure exit_CB; }; }; !********************* ! declare Text !********************* text1 : XmText { arguments{ XmNx = 50; XmNy = 150; }; }; end module; /* * C source file - uil_sample.c * */ #include <Mrm/MrmAppl.h> #include <locale.h> void exit_CB(); static MrmHierarchy hierarchy; static MrmType *class; /******************************************/ /* specify the UID hierarchy list */ /******************************************/ static char *aray_file[]= {"uil_sample.uid" }; static int num_file = (sizeof aray_file / sizeof aray_file[0]); /******************************************************/ /* define the mapping between UIL procedure names */ /* and their addresses */ /******************************************************/ static MRMRegisterArg reglist[]={ {"exit_CB",(caddr_t) exit_CB}