12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Xlib</strong> − C LibraryX11, Release 6.7 DRAFTChapter 13Locales and Internationalized Text FunctionsAn internationalized application is one that is adaptable to the requirements of different nativelanguages, local customs, and character string encodings. The process of adapting the operationto a particular native language, local custom, or string encoding is called localization. Agoal ofinternationalization is to permit localization without program source modifications or recompilation.As one of the localization mechanisms, <strong>Xlib</strong> provides an X Input Method (XIM) functional interfacefor internationalized text input and an X Output Method (XOM) functional interface forinternationalized text output.Internationalization in X is based on the concept of a locale. Alocale defines the localizedbehavior of a program at run time. Locales affect <strong>Xlib</strong> in its:• Encoding and processing of input method text• Encoding of resource files and values• Encoding and imaging of text strings• Encoding and decoding for inter-client text communicationCharacters from various languages are represented in a computer using an encoding. Differentlanguages have different encodings, and there are even different encodings for the same charactersin the same language.This chapter defines support for localized text imaging and text input and describes the localemechanism that controls all locale-dependent <strong>Xlib</strong> functions. Sets of functions are provided formultibyte (char *) text as well as wide character (wchar_t) text in the form supported by the hostClanguage environment. The multibyte and wide character functions are equivalent except forthe form of the text argument.The <strong>Xlib</strong> internationalization functions are not meant to provide support for multilingual applications(mixing multiple languages within a single piece of text), but they make itpossible to implementapplications that work in limited fashion with more than one language in independent contexts.The remainder of this chapter discusses:• X locale management• Locale and modifier dependencies• Variable argument lists• Output methods• Input methods• String constants13.1. X Locale ManagementXsupports one or more of the locales defined by the host environment. On implementations thatconform to the ANSI C library, the locale announcement method is setlocale. This function configuresthe locale operation of both the host C library and <strong>Xlib</strong>. The operation of <strong>Xlib</strong> is governed273

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!