10.4 String Encoding Changes for Internationalization

Perhaps the most fundamental concern of internationalization is the encoding of strings. So far we’ve considered text drawing and string input, and have used multi-byte or wide-character strings in the encoding of the locale. Because X is a networked window system, however, an X client must communicate with the X server, usually with a window manager, sometimes with a session manager, and often with other clients through the X selection mechanism (which is used to implement copy-and-paste). When we allow the internationalization of X programs, we must confront the issues of communication between clients that use different locales, and of communication between an internationalized client and a “locale-neutral” X server. Furthermore we must make decisions about the encodings of any other strings used in the X and Xt specifications.

Some of the issues that must be considered are the appropriate encoding for color and font names passed to the X server, the encoding of bitmap files, the encoding of strings selected in one client and copied to another, and the encoding of resource values and names. When making decisions on questions like these, the designers of X internationalization had several choices. They could specify that particular strings were:

  • In the encoding of the locale.

  • In the COMPOUND_TEXT encoding, in which each string is encoded along with the name of its encoding.

  • In the STRING encoding, which is Latin-1 plus the newline ...

Get XLIB Programming Manual, Rel. 5, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.