Title and Copyright Information
 
About This Manual
Audience
New and Changed Features
Organization
Related Documentation and Standards
Reader's Comments
Conventions
 
1    Overview of International Software Development
1.1    Language Announcement
1.1.1    Localization
1.2    Language
1.2.1    Character Classification
1.2.2    Case Conversion
1.2.3    Message Catalogs
1.3    Cultural Data
1.3.1    Language Information
1.4    Character Sets
1.4.1    Collating Sequence
1.4.2    Characters and Strings
1.4.3    Portable Character Set
1.4.4    Universal Character Set
 
2    Developing Internationalized Software
2.1    Using Locales
2.2    Using Codesets
2.2.1    Ensuring Data Transparency
2.2.2    Using In-Code Literals
2.2.3    Manipulating Characters That Span Multiple Bytes
2.2.4    Converting Between Multibyte-Character and Wide-Character Data
2.2.5    Rules for Multibyte Characters in Source and Execution Codesets
2.2.6    Classifying Characters
2.2.7    Converting Characters
2.2.8    Comparing Strings
2.3    Handling Cultural Data
2.3.1    The langinfo Database
2.3.2    Querying the langinfo Database
2.3.3    Generating and Interpreting Date and Time Strings That Observe Local Customs
2.3.4    Formatting Monetary Values
2.3.5    Formatting Numeric Values in Program-Specific Ways
2.3.6    Using the langinfo Database for Other Tasks
2.4    Handling Text Presentation and Input
2.4.1    Creating and Using Messages
2.4.2    Formatting Output Text
2.4.3    Scanning Input Text
2.5    Binding a Locale to the Run-Time Environment
2.5.1    Binding to the Locale Set for the System or User
2.5.2    Changing Locales During Program Execution
 
3    Creating and Using Message Catalogs
3.1    Creating Message Text Source Files
3.1.1    General Rules
3.1.2    Message Sets
3.1.3    Message Entries
3.1.4    Quote Directive
3.1.5    Comment Lines
3.1.6    Style Guidelines for Messages
3.2    Extracting Message Text from Existing Programs
3.3    Editing and Translating Message Source Files
3.4    Generating Message Catalogs
3.4.1    Using the mkcatdefs Command
3.4.2    Using the gencat Command
3.4.3    Design and Maintenance Considerations for Message Catalogs
3.5    Displaying Messages and Locale Data
3.6    Accessing Message Catalogs in Programs
3.6.1    Opening Message Catalogs
3.6.2    Closing Message Catalogs
3.6.3    Reading Program Messages
 
4    Handling Wide-Character Data with curses Library Routines
4.1    Writing a Wide Character to a curses Window
4.1.1    Add Wide Character (Overwrite) and Advance Cursor
4.1.2    Insert Wide Character (No Overwrite) and Do Not Advance Cursor
4.2    Writing a Wide-Character String to a curses Window
4.2.1    Add Wide-Character String (Overwrite) and Do Not Advance Cursor
4.2.2    Add Wide-Character String (Overwrite) and Advance Cursor
4.2.3    Insert Wide-Character String (no Overwrite) and Do Not Advance Cursor
4.3    Removing a Wide Character from a curses Window
4.4    Reading a Wide Character from a curses Window
4.5    Reading a Wide-Character String from a curses Window
4.5.1    Reading Wide-Character Strings with Attributes
4.5.2    Reading Wide-Character Strings Without Attributes
4.6    Reading a String of Characters from a Terminal
4.7    Reading or Queuing a Wide Character from the Keyboard
4.8    Converting Formatted Text in a curses Window
4.9    Printing Formatted Text on a curses Window
 
5    Creating Internationalized X, Xt, and Motif Applications
5.1    Using Internationalization Features in the Xt Intrinsics Library
5.1.1    Establishing a Locale with Xt Functions
5.1.2    Using Font Set Resources with Xt Functions
5.1.3    Filtering Events During Text Input with Xt Library Functions
5.1.4    Including the Codeset Component of Locales with Xt Library Functions
5.2    Using Internationalization Features of the OSF/Motif and DECwindows Motif Toolkits
5.2.1    Setting Language in a Motif Application
5.2.2    Using Compound Strings and the XmText and XmTextField Widgets
5.2.3    Internationalization Features of Widget Classes
5.3    Using Internationalization Features in the X Library
5.3.1    Managing Locales
5.3.2    Displaying Text for Different Locales
5.3.2.1    Creating and Manipulating Font Sets
5.3.2.2    Obtaining Metrics for Font Sets
5.3.2.3    Drawing Text with Font Sets
5.3.2.4    Handling Text with the X Output Method
5.3.2.5    Converting Between Different Font Set Encodings
5.3.3    Handling Interclient Communication
5.3.4    Handling Localized Resource Databases
5.3.5    Handling Text Input with the X Input Method
5.3.5.1    Opening and Closing an Input Method
5.3.5.2    Querying Input Method Values
5.3.5.3    Creating and Using Contexts for an Input Method
5.3.5.4    Providing Preediting Callbacks for the On-the-Spot Input Style
5.3.5.5    Filtering Events for an Input Method
5.3.5.6    Obtaining Composed Strings from the Keyboard
5.3.5.7    Handling Failure of the Input Method Server
5.3.6    Using Xt and X Library Features: A Summary
 
6    Creating Locales
6.1    Creating a Character Map Source File for a Locale
6.2    Creating Locale Definition Source Files
6.2.1    Defining the LC_CTYPE Locale Category
6.2.2    Defining the LC_COLLATE Locale Category
6.2.3    Defining the LC_MESSAGES Locale Category
6.2.4    Defining the LC_MONETARY Locale Category
6.2.5    Defining the LC_NUMERIC Locale Category
6.2.6    Defining the LC_TIME Locale Category
6.3    Building Libraries to Convert Multibyte and Wide-Character Encodings
6.3.1    Required Methods
6.3.1.1    Writing the _ _mbstopcs Method for the fgetws Function
6.3.1.2    Writing the _ _mbtopc Method for the getwc( ) Function
6.3.1.3    Writing the _ _pcstombs Method for the fputws( ) Function
6.3.1.4    Writing a _ _pctomb Method
6.3.1.5    Writing a Method for the mblen( ) Function
6.3.1.6    Writing a Method for the mbstowcs( ) Function
6.3.1.7    Writing a Method for the mbtowc( ) Function
6.3.1.8    Writing a Method for the wcstombs( ) Function
6.3.1.9    Writing a Method for the wctomb( ) Function
6.3.1.10    Writing a Method for the wcswidth( ) Function
6.3.1.11    Writing a Method for the wcwidth( ) Function
6.3.2    Optional Methods
6.3.3    Building a Shareable Library to Use with a Locale
6.3.4    Creating a methods File for a Locale
6.4    Building and Testing the Locale
 
7    Programming Considerations for International Applications
7.1    Choosing an Input Method
7.2    Managing User-Defined Characters and Phrase Input
7.3    Assigning a Sort Order with a Locale Specification
7.4    Processing Non-English Language Reference Pages
7.4.1    The nroff Command
7.4.2    The tbl Command
7.4.3    The man Command
7.5    Converting Data Files from One Codeset to Another
7.6    Using Font Renderers in Chinese and Korean PostScript Support
7.6.1    Using Font Renderers for Multibyte PostScript Fonts
7.6.1.1    Setting Up the Font Renderer for Double-Byte PostScript Fonts
7.6.1.2    Setting Up the Font Renderer for UDC Fonts
7.6.1.3    Using the Font Renderer for TrueType Fonts
 
A    Summary Tables of Worldwide Portability Interfaces
A.1    Locale Announcement
A.2    Character Classification
A.3    Case and Generic Property Conversion
A.4    Character Collation
A.5    Access to Data That Varies According to Language and Custom
A.6    Conversion and Format of Date/Time Values
A.7    Printing and Scanning Text
A.8    Number Conversion
A.9    Conversion of Multibyte and Wide-Character Values
A.10    Input and Output
A.11    String Handling
A.12    Codeset Conversion
 
B    Setting Up and Using User-Defined Character Databases
B.1    Creating User-Defined Characters
B.1.1    Working on the cedit User Interface Screen
B.1.2    Editing Font Glyphs
B.2    Creating UDC Support Files That System Software Uses
B.3    Processing UDC Fonts for Use with X11 or Motif Applications
B.3.1    Using fontconverter Command Options
B.3.2    Controlling Output File Format
 
C    Using DECterm Localization Features in Programs
C.1    Drawing Ruled Lines in a DECterm Window
C.1.1    Drawing Ruled Lines in a Pattern
C.1.2    Erasing Ruled Lines in a Pattern
C.1.3    Erasing All Ruled Lines in an Area
C.1.4    Interaction of Ruled Lines and Other DECterm Escape Sequences
C.1.5    Determining DECterm Support for Ruled Lines
C.2    DECterm Programming Restrictions
C.2.1    Downline Loadable Characters
C.2.2    DRCS Characters
 
D    Sample Locale Source Files
D.1    Character Map (charmap) Source File
D.2    Locale Definition Source File
 
Glossary
 
Examples
3-1    Message Text Source File
3-2    Generating a Message Catalog Interactively
5-1    Setting Locale in an X Window Application
5-2    Creating and Using Font Sets in an X Window Application
5-3    Drawing Text in an X Window Application
5-4    Communicating with Other Clients in an X Window Application
5-5    Opening and Closing an Input Method in an X Window Application
5-6    Obtaining User Interaction Styles for an Input Method
5-7    Creating and Destroying an Input Method Context in an X Window Application
5-8    Using Preediting Callbacks in an X Window Application
5-9    Filtering Events for an Input Method in an X Window Application
5-10    Obtaining Keyboard Input in an X Window Application
5-11    Handling Failure of the Input Method Server
6-1    The charmap File for a Sample Locale
6-2    Fragment from a charmap File for a Multibyte Codeset
6-3    Structure of Locale Source Definition File
6-4    LC_CTYPE Category Definition
6-5    LC_COLLATE Category Definition
6-6    LC_MESSAGES Category Definition
6-7    LC_MONETARY Category Definition
6-8    LC_NUMERIC Category Definition
6-9    LC_TIME Category Definition
6-10    The _ _mbstopcs_sdeckanji Method for the ja_JP.sdeckanji Locale
6-11    The _ _mbtopc_sdeckanji Method for the ja_JP.sdeckanji Locale
6-12    The _ _pcstombs_sdeckanji Method for the ja_JP.sdeckanji Locale
6-13    The _ _pctomb_sdeckanji Method for the ja_JP.sdeckanji Locale
6-14    The _ _mblen_sdeckanji Method for the ja_JP.sdeckanji Locale
6-15    The _ _mbstowcs_sdeckanji Method for the ja_JP.sdeckanji Locale
6-16    The _ _mbtowc_sdeckanji Method for the ja_JP.sdeckanji Locale
6-17    The _ _wcstombs_sdeckanji Method for the ja_JP.sdeckanji Locale
6-18    The _ _wctomb_sdeckanji Method for the ja_JP.sdeckanji Locale
6-19    The _ _wcswidth_sdeckanji Method for the ja_JP.sdeckanji Locale
6-20    The _ _wcwidth_sdeckanji Method for the ja_JP.sdeckanji Locale
6-21    Building a Library of Methods Used with the ja_JP.sdeckanji Locale
6-22    The methods File for the ja_JP.sdeckanji Locale
6-23    Building the fr_FR.ISO8859-1@example Locale
6-24    Setting the LOCPATH Variable and Testing a Locale
7-1    Default cp_dirs File
 
Figures
3-1    Converting an Existing Program to Use a Message Catalog
B-1    Components That Support User-Defined Characters
B-2    The cedit User Interface Screen
B-3    The cedit Font Editing Screen
B-4    Interpretation of Font Editing Screen for Sizing a Font
B-5    Keymap for cedit Functions
C-1    Drawing Ruled Lines with the DECDRLBR Sequence
C-2    Bit Pattern for DECDRLBR Parameters
 
Tables
3-1    Coding of Special Characters in Message Text Source Files
4-1    curses Routines to Add Wide Characters and Advance the Cursor
4-2    curses Routines to Insert Wide Characters and Not Advance the Cursor
4-3    curses Routines to Add Wide-Character Strings and Not Advance the Cursor
4-4    curses Routines to Add Wide-Character Strings and Advance the Cursor
4-5    curses Routines to Insert Wide-Character Strings and Not Advance the Cursor
4-6    curses Routines to Remove a Wide Character
4-7    curses Routines to Read Wide Characters From a Window
4-8    curses Routines to Read Wide-Character Strings With Attributes
4-9    curses Routines to Read Wide-Character Strings Without Attributes
4-10    curses Routines to Read Wide-Character Strings From a Terminal
4-11    curses Routines for Reading Wide Characters From the Keyboard
4-12    curses Routines to Convert Formatted Text in a Window
4-13    curses Routines to Print Formatted Text on a Window
5-1    Locale Announcement Functions in the X Library
5-2    X Library Functions That Create and Manipulate Font Sets
5-3    X Library Functions That Measure Text
5-4    X Library Functions That Draw Text
5-5    X Library Functions for Output Method and Context
5-6    X Library Functions for Interclient Communication
5-7    X Library Functions That Handle Localized Resource Databases
5-8    X Library Functions That Manage Input Context (XIC)
7-1    Supported Codeset Conversions for English
7-2    XLFD Registry Names for UDC Characters
B-1    The stty Options for On-Demand Loading of UDC Support Files
B-2    The cedit Command Options
B-3    Keys for Miscellaneous Font Editing Functions
B-4    Keys for cedit Mode Switching
B-5    Keys for Fine Control of Cursor Movement
B-6    Keys for Moving Cursor to Window Areas
B-7    Keys for Drawing Font Glyphs
B-8    Keys for Editing Font Glyphs
B-9    The cgen Command Options
B-10    Options and Arguments of the fontconverter Command
C-1    Behavior of Standard Escape Sequences with Ruled Lines
 
Index