International Language Environments Guide
Total Page:16
File Type:pdf, Size:1020Kb
International Language Environments Guide Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054 U.S.A. Part No: 806–6642–10 May, 2002 Copyright 2002 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. Sun, Sun Microsystems, the Sun logo, docs.sun.com, AnswerBook, AnswerBook2, Java, XView, ToolTalk, Solstice AdminTools, SunVideo and Solaris are trademarks, registered trademarks, or service marks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. SunOS, Solaris, X11, SPARC, UNIX, PostScript, OpenWindows, AnswerBook, SunExpress, SPARCprinter, JumpStart, Xlib The OPEN LOOK and Sun™ Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun’s licensees who implement OPEN LOOK GUIs and otherwise comply with Sun’s written license agreements. Federal Acquisitions: Commercial Software–Government Users Subject to Standard License Terms and Conditions. DOCUMENTATION IS PROVIDED “AS IS” AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. Copyright 2002 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. Tous droits réservés Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l’utilisation, la copie, la distribution, et la décompilation. Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme, par quelque moyen que ce soit, sans l’autorisation préalable et écrite de Sun et de ses bailleurs de licence, s’il y en a. Le logiciel détenu par des tiers, et qui comprend la technologie relative aux polices de caractères, est protégé par un copyright et licencié par des fournisseurs de Sun. Des parties de ce produit pourront être dérivées du système Berkeley BSD licenciés par l’Université de Californie. UNIX est une marque déposée aux Etats-Unis et dans d’autres pays et licenciée exclusivement par X/Open Company, Ltd. Sun, Sun Microsystems, le logo Sun, docs.sun.com, AnswerBook, AnswerBook2, et Solaris sont des marques de fabrique ou des marques déposées, ou marques de service, de Sun Microsystems, Inc. aux Etats-Unis et dans d’autres pays. Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d’autres pays. Les produits portant les marques SPARC sont basés sur une architecture développée par Sun Microsystems, Inc. L’interface d’utilisation graphique OPEN LOOK et Sun™ a été développée par Sun Microsystems, Inc. pour ses utilisateurs et licenciés. Sun reconnaît les efforts de pionniers de Xerox pour la recherche et le développement du concept des interfaces d’utilisation visuelle ou graphique pour l’industrie de l’informatique. Sun détient une licence non exclusive de Xerox sur l’interface d’utilisation graphique Xerox, cette licence couvrant également les licenciés de Sun qui mettent en place l’interface d’utilisation graphique OPEN LOOK et qui en outre se conforment aux licences écrites de Sun. CETTE PUBLICATION EST FOURNIE “EN L’ETAT” ET AUCUNE GARANTIE, EXPRESSE OU IMPLICITE, N’EST ACCORDEE, Y COMPRIS DES GARANTIES CONCERNANT LA VALEUR MARCHANDE, L’APTITUDE DE LA PUBLICATION A REPONDRE A UNE UTILISATION PARTICULIERE, OU LE FAIT QU’ELLE NE SOIT PAS CONTREFAISANTE DE PRODUIT DE TIERS. CE DENI DE GARANTIE NE S’APPLIQUERAIT PAS, DANS LA MESURE OU IL SERAIT TENU JURIDIQUEMENT NUL ET NON AVENU. 020304@3332 Contents Preface 15 1 Solaris Internationalization Overview 21 New Internationalization and Localization Features 22 Internationalization and Localization Defined 23 Basic Steps in Internationalization 23 Localization Functions in Solaris Interfaces 25 What Is a Locale? 26 Full and Partial Locales 27 Behavior Affected by Locales 28 Locale Categories 28 Using Locale Categories for Localization 29 Time Formats 29 Date Formats 30 Numbers 30 Currency 31 Language Word and Letter Differences 33 Word Delimiters 33 Sort Order 34 Character Sets 34 Keyboard Differences 36 Differences in Paper Sizes 37 2 General Internationalization Features 39 Support for Codeset Independence 39 3 CSI Approach 40 CSI-enabled Commands 40 Solaris 9 CSI-enabled Libraries 41 Locale Database 41 Process Code Format 42 Multibyte Support Environment 42 Dynamically Linked Applications 43 Changed Interfaces 43 ctype Macros 44 Internationalization APIs in libc 45 genmsg Utility 52 User Defined and User Extensible Code Conversions 53 3 Localization in the Solaris 9 Environment 55 Software Support for Localization 55 Summary of the Solaris 9 Locale Packages 55 Additional Locales in This Release 56 Supported Locales 57 Multiple Key Compose Sequences for Locales 63 Keyboard Support in the Solaris 9 Product 64 Changing Between Keyboards on SPARC Systems 66 Changing Between Keyboards on Intel Systems 69 4 Supported Asian Locales 77 Asian Supported Locales 77 Input Method Auxiliary Window Support for Simplified and Traditional Chinese 78 Thai Localization 80 Thai Input Method Auxiliary Window 80 Simplified Chinese Localization 80 Traditional Chinese Localization 83 Japanese Localization 86 Japanese Locales 86 Japanese Character Sets 86 Japanese Fonts 87 Japanese Input Systems 88 Terminal Setting for Japanese Terminals 88 4 International Language Environments Guide • May, 2002 Japanese iconv Module 89 User-Defined Character Support 89 Differences Between Partial and Full Locales 89 Korean Localization 90 5 Overview of UTF-8 Locale Support 93 Unicode Overview 93 Unicode Locale: en_US.UTF-8 Support Overview 94 Desktop Input Methods 96 Script Selection and Input Modes 97 Accessing Input Mode 97 Traditional Chinese Input Mode 114 Traditional Chinese (Hong Kong) Input Mode 114 Unicode Hexadecimal Input Mode 114 Table Lookup Input Mode 115 System Environment 115 Locale Environment Variable 115 TTY Environment Setup 116 Code Conversions 119 DtMail 120 Programming Environment 122 FontSet Used with X Applications 123 FontList Definition in CDE/Motif Applications 123 6 Complex Text Layout 125 Overview of CTL Technology 125 Overview of CTL Architecture 126 CTL Support for X Library Based Applications 126 New XOC Resources 126 Changes in Motif to Support CTL Technology 127 XmNlayoutDirection 128 Determining the Layout Direction 128 XmStringDirection 129 XmRendition 129 Additional Layout Behavior 130 XmText and XmTextField 131 Character Orientation Action Routines 132 Contents 5 Character Orientation Additional Behavior 132 XmText Action Routines 132 XmTextFieldGetLayoutModifier 135 XmTextGetLayoutModifier 135 XmTextFieldSetLayoutModifier 136 XmTextSetLayoutModifier 136 XmStringDirectionCreate 137 UIL Arguments 137 How to Develop CTL Applications 138 Layout Direction 138 Creating a Rendition 139 Editing a Rendition 140 Creating a Render Table in a Resource File 141 Creating a Render Table in an Application 142 Horizontal Tabs 143 Mouse Selection 144 Keyboard Selection 145 Text Resources and Geometry 145 Porting Instructions 146 7 Print Filter Enhancement With mp 147 Printing for UTF-8 147 mp Print Filter Enhancement Overview 148 Using mp with the Locale Specific Font Configuration File mp.conf 149 Using mp With the Locale-specific PostScript Prologue Files 149 Using mp as an Xprt (X Print Server) Client 149 Localization of the Configuration File 150 Customizing Existing prolog Files and Adding New prolog Files 156 PostScript File Customization 156 .xpr File Customization 159 Creating a New .xpr File 162 6 International Language Environments Guide • May, 2002 A iconv Code Conversions 165 B Partial Locale Package List on Software CDs 193 C Full Locale Package List on Languages CD 201 Index 221 Contents 7 8 International Language Environments Guide • May, 2002 Tables TABLE 1–1 International Time Formats 29 TABLE 1–2 International Date Formats 30 TABLE 1–3 International Numeric Conventions 31 TABLE 1–4 International Monetary Conventions 31 TABLE 1–5 User Locales To Support the Euro Currency 32 TABLE 1–6 German Locale and Corresponding LC_MONETARY 33 TABLE 1–7 Common International Page Sizes 37 TABLE 2–1 Messaging Functions in libc 45 TABLE 2–2 Code Conversion in libc 46 TABLE 2–3 Regular Expressions in libc 46 TABLE 2–4 Wide Character Class in libc 46 TABLE 2–5 Modify and Query Locale in libc