Chapter 13. Examples of I18N
96
This enables TWM to properly receive the internationalized window text names from X
clients.
  Usage of
XGetWMIconName()
and
XmbTextPropertyToTextList()
for inter client com 
munication of window icon names. This enables TWM to properly receive the internation 
alized window icon names from X clients.
  8bit cleanization of the configuration file parser. This enables usage of internationalized
texts for menus and so on.
The following will present these items.
13.1.2 Locale Setting   A Routine Work
At first, I added a small part to call
setlocale()
at the beginning of
main()
function.
loc = setlocale(LC_ALL, "");
if (!loc || !strcmp(loc, "C") || !strcmp(loc, "POSIX") ||
!XSupportsLocale()) {
use_fontset = False;
} else {
use_fontset = True;
}
loc
is
char *
 type auto (local) variable.
use_fontset
is
Bool
 type global variable, for which
I wrote a declaration in
twm.h
.
extern Bool use_fontset;
I also added inclusion of
X11/Xlocale.h
header file. By including of this header file, locale
feature of X11 will be used when compiled in OS without locale features. Otherwise, X11/Xlocale
will use locale features of the OS. Thus, you can include
X11/Xlocale.h
regardless of whether
the OS support locale.
Checking of NULL,  C , and  POSIX  locales will enable TWM to work 8bit through when the
user does not configure locale properly. Under  C  or  POSIX  locale, or without proper con 
figuration of locale,
XFontSet
 related functions will work under 7bit ASCII encoding and these
functions will regard all 8bit characters as invalid. In such cases, my patch won't use
XFontSet
related functions by checking the value of
use_fontset
. Checking of
XSupportLocale()
is
needed for cases when the OS support the locale while X doesn't support the locale.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

indiana web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Inexpensive Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Jsp Hosting Cheap Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved