home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 August - Disc 2 / chip_20018102_hu.iso / linux / X-4.1.0 / doc / localedb.txt < prev    next >
Text File  |  2001-06-27  |  14KB  |  661 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.         X Locale Database Definition
  12.  
  13.  
  14.  
  15.               Yoshio Horiuchi
  16.              IBM Japan
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77. Copyright (C) IBM Corporation 1994
  78.  
  79. All Rights Reserved
  80.  
  81. License to use, copy, modify, and distribute this software
  82. and its documentation for any purpose and without fee is
  83. hereby granted, provided that the above copyright notice
  84. appear in all copies and that both that copyright notice and
  85. this permission notice appear in supporting documentation,
  86. and that the name of IBM not be used in advertising or pub-
  87. licity pertaining to distribution of the software without
  88. specific, written prior permission.
  89.  
  90. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  91. INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FIT-
  92. NESS, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS, IN NO EVENT
  93. SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUEN-
  94. TIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
  95. OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
  96. NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  97. CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  98.  
  99.  
  100.  
  101.  
  102.  
  103. Copyright (C) 1994 X Consortium
  104.  
  105. Permission is hereby granted, free of charge, to any person
  106. obtaining a copy of this software and associated documenta-
  107. tion files (the ``Software''), to deal in the Software with-
  108. out restriction, including without limitation the rights to
  109. use, copy, modify, merge, publish, distribute, sublicense,
  110. and/or sell copies of the Software, and to permit persons to
  111. whom the Software is furnished to do so, subject to the fol-
  112. lowing conditions:
  113.  
  114. The above copyright notice and this permission notice shall
  115. be included in all copies or substantial portions of the
  116. Software.
  117.  
  118. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY
  119. KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  120. WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PUR-
  121. POSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE X CONSOR-
  122. TIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  123. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  124. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
  125. OR OTHER DEALINGS IN THE SOFTWARE.
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. Except as contained in this notice, the name of the X Con-
  140. sortium shall not be used in advertising or otherwise to
  141. promote the sale, use or other dealings in this Software
  142. without prior written authorization from the X Consortium.
  143.  
  144.  
  145.  
  146. X Window System is a trademark of X Consortium, Inc.
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205. 1.  General
  206.  
  207. An X Locale Database contains the subset of a user's envi-
  208. ronment that depends on language, in X Window System.  It is
  209. made up from one or more categories.  Each category consists
  210. of some classes and sub-classes.
  211.  
  212. It is provided as a plain ASCII text file, so a user can
  213. change its contents easily.  It allows a user to customize
  214. the behavior of internationalized portion of Xlib without
  215. changing Xlib itself.
  216.  
  217. This document describes;
  218.  
  219.       Database Format Definition
  220.  
  221.       Contents of Database in sample implementation
  222.  
  223. Since it is hard to define the set of required information
  224. for all platforms, only the flexible database format is
  225. defined.  The available entries in database are implementa-
  226. tion dependent.
  227.  
  228.  
  229. 2.  Database Format Definition
  230.  
  231. The X Locale Database contains one or more category defini-
  232. tions.    This section describes the format of each category
  233. definition.
  234.  
  235. The category definition consists of one or more class defi-
  236. nitions.  Each class definition has a pair of class name and
  237. class value, or has several subclasses which are enclosed by
  238. the left brace ({) and the right brace (}).
  239.  
  240. Comments can be placed by using the number sign character
  241. (#).  Putting the number sign character on the top of the
  242. line indicates that the entire line is comment.  Also,
  243. putting any whitespace character followed by the number sign
  244. character indicates that a part of the line (from the number
  245. sign to the end of the line) is comment.  A line can be con-
  246. tinued by placing backslash (\) character as the last char-
  247. acter on the line;  this continuation character will be dis-
  248. carded from the input.    Comment lines cannot be continued on
  249. a subsequent line using an escaped new line character.
  250.  
  251. X Locale Database only accepts XPCS, the X Portable Charac-
  252. ter Set.  The reserved symbols are;  the quotation mark("),
  253. the number sign (#), the semicolon(;), the backslash(\), the
  254. left brace({) and the right brace(}).
  255.  
  256. The format of category definition is;
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                   1
  263.  
  264.  
  265.  
  266.  
  267.  
  268. X Locale Database Definition            X11, Release 6.4
  269.  
  270.  
  271.      CategoryDefinition   ::=    CategoryHeader CategorySpec CategoryTrailer
  272.      CategoryHeader      ::=    CategoryName NL
  273.      CategorySpec      ::=    { ClassSpec }
  274.      CategoryTrailer      ::=    "END" Delimiter CategoryName NL
  275.      CategoryName      ::=    String
  276.      ClassSpec          ::=    ClassName Delimiter ClassValue NL
  277.      ClassName          ::=    String
  278.      ClassValue       ::=    ValueList | "{" NL { ClassSpec } "}"
  279.      ValueList          ::=    Value | Value ";" ValueList
  280.      Value          ::=    ValuePiece | ValuePiece Value
  281.      ValuePiece       ::=    String | QuotedString | NumericString
  282.      String          ::=    Char { Char }
  283.      QuotedString      ::=    """ QuotedChar { QuotedChar } """
  284.      NumericString      ::=    "\\o" OctDigit { OctDigit }
  285.                 |    "\\d" DecDigit { DecDigit }
  286.                 |    "\\x" HexDigit { HexDigit }
  287.      Char          ::=    <XPCS except NL, Space or unescaped reserved symbols>
  288.      QuotedChar       ::=    <XPCS except unescaped """>
  289.      OctDigit          ::=    <character in the range of "0" - "7">
  290.      DecDigit          ::=    <character in the range of "0" - "9">
  291.      HexDigit          ::=    <character in the range of "0" - "9", "a" - "f", "A" - "F">
  292.      Delimiter          ::=     Space { Space }
  293.      Space          ::=    <space> | <horizontal tab>
  294.      NL           ::=    <newline>
  295.  
  296.  
  297. Elements separated by vertical bar (|) are alternatives.
  298. Curly braces ({...}) indicate zero or more repetitions of
  299. the enclosed elements.    Square brackets ([...]) indicate
  300. that the enclosed element is optional. Quotes ("...") are
  301. used around literal characters.
  302.  
  303. The backslash, which is not the top character of the Numer-
  304. icString, is recognized as an escape character, so that the
  305. next one character is treated as a literal character.  For
  306. example, the two-character sequence, ``\"''(the backslash
  307. followed by the quotation mark) is recognized and replaced
  308. with a quotation mark character.  Any whitespace character,
  309. that is not the Delimiter, unquoted and unescaped, is
  310. ignored.
  311.  
  312.  
  313. 3.  Contents of Database
  314.  
  315. The available categories and classes depend on implementa-
  316. tion, because different platform will require different
  317. information set.  For example, some platform have system
  318. locale but some platform don't.  Furthermore, there might be
  319. a difference in functionality even if the platform has sys-
  320. tem locale.
  321.  
  322. In current sample implementation, categories listed below
  323. are available.
  324.  
  325.  
  326.  
  327.  
  328.                   2
  329.  
  330.  
  331.  
  332.  
  333.  
  334. X Locale Database Definition            X11, Release 6.4
  335.  
  336.  
  337.      XLC_FONTSET   XFontSet relative information
  338.      XLC_XLOCALE   Character classification and conversion information
  339.  
  340.  
  341.  
  342. 4.  XLC_FONTSET Category
  343.  
  344. The XLC_FONTSET category defines the XFontSet relative
  345. information.  It contains the CHARSET_REGISTRY-
  346. CHARSET_ENCODING name and character mapping side (GL, GR,
  347. etc), and is used in Output Method (OM).
  348.  
  349.      -----------------------------------------------------------
  350.      class           super class   description
  351.      -----------------------------------------------------------
  352.      fsN                 Nth fontset (N=0,1,2, ...)
  353.  
  354.      charset           fsN         list of encoding name
  355.      font           fsN         list of font encoding name
  356.      -----------------------------------------------------------
  357.  
  358.  
  359.  
  360. fsN
  361.      Includes an encoding information for Nth charset, where
  362.      N is the index number (0,1,2,...).  If there are 4
  363.      charsets available in current locale, 4 fontsets, fs0,
  364.      fs1, fs2 and fs3, should be defined.  This class has
  365.      two subclasses, `charset' and `font'.
  366.  
  367. charset
  368.      Specifies an encoding information to be used internally
  369.      in Xlib for this fontset.    The format of value is;
  370.  
  371.       EncodingInfo     ::=   EncodingName [ ":" EncodingSide ]
  372.       EncodingName     ::=   CHARSET_REGISTRY-CHARSET_ENCODING
  373.       EncodingSide     ::=   "GL" | "GR"
  374.  
  375.      For detail definition of CHARSET_REGISTRY-
  376.      CHARSET_ENCODING, refer "X Logical Font Descriptions"
  377.      document.
  378.  
  379.      example:
  380.       ISO8859-1:GL
  381.  
  382. font
  383.      Specifies a list of encoding information which is used
  384.      for searching appropriate font for this fontset.  The
  385.      left most entry has highest priority.
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.                   3
  395.  
  396.  
  397.  
  398.  
  399.  
  400. X Locale Database Definition            X11, Release 6.4
  401.  
  402.  
  403. 5.  XLC_XLOCALE Category
  404.  
  405. The XLC_XLOCALE category defines character classification,
  406. conversion and other character attributes.
  407.  
  408.      -----------------------------------------------------------------------
  409.      class             super class   description
  410.      -----------------------------------------------------------------------
  411.      encoding_name               codeset name
  412.      mb_cur_max                MB_CUR_MAX
  413.      state_depend_encoding           state dependent or not
  414.      wc_encoding_mask               for parsing wc string
  415.      wc_shift_bits               for conversion between wc and mb
  416.      csN                   Nth charset (N=0,1,2,...)
  417.  
  418.      side             csN       mapping side (GL, etc)
  419.      length             csN       length of a character
  420.      mb_encoding         csN       for parsing mb string
  421.      wc_encoding         csN       for parsing wc string
  422.      ct_encoding         csN       list of encoding name for ct
  423.      -----------------------------------------------------------------------
  424.  
  425.  
  426.  
  427. encoding_name
  428.      Specifies a codeset name of current locale.
  429.  
  430. mb_cur_max
  431.      Specifies a maximum allowable number of bytes in a
  432.      multi-byte character.  It is corresponding to
  433.      MB_CUR_MAX of "ISO/IEC 9899:1990 C Language Standard".
  434.  
  435. state_depend_encoding
  436.      Indicates a current locale is state dependent. The
  437.      value should be specified "True" or "False".
  438.  
  439. wc_encoding_mask
  440.      Specifies a bit-mask for parsing wide-char string.
  441.      Each wide character is applied bit-and operation with
  442.      this bit-mask, then is classified into the unique
  443.      charset, by using `wc_encoding'.
  444.  
  445. wc_shift_bits
  446.      Specifies a number of bit to be shifted for converting
  447.      from a multi-byte character to a wide character, and
  448.      vice-versa.
  449.  
  450. csN
  451.      Includes a character set information for Nth charset,
  452.      where N is the index number (0,1,2,...).  If there are
  453.      4 charsets available in current locale, cs0, cs1, cs2
  454.      and cs3 should be defined. This class has five sub-
  455.      classes, `side', `length', `mb_encoding' `wc_encoding'
  456.      and `ct_encoding'.
  457.  
  458.  
  459.  
  460.                   4
  461.  
  462.  
  463.  
  464.  
  465.  
  466. X Locale Database Definition            X11, Release 6.4
  467.  
  468.  
  469. side
  470.      Specifies a mapping side of this charset. The format of
  471.      this value is;
  472.  
  473.       Side     ::=   EncodingSide [``:Default'']
  474.  
  475.      The suffix ":Default" can be specified.  It indicates
  476.      that a character belongs to the specified side is
  477.      mapped to this charset in initial state.
  478.  
  479. length
  480.      Specifies a number of bytes of a multi-byte character
  481.      of this charset.  It should not contain the length of
  482.      any single-shift sequence.
  483.  
  484. mb_encoding
  485.      Specifies a list of shift sequence for parsing multi-
  486.      byte string.  The format of this value is;
  487.  
  488.       MBEncoding      ::=    ShiftType ShiftSequence
  489.                 |    ShiftType ShiftSequence ";" MBEncoding
  490.       ShiftType      ::=    "<SS>" | "<LSL>" | "<LSR>"
  491.       ShiftSequence   ::=    SequenceValue | SequenceValue ShiftSequence
  492.       SequenceValue   ::=    NumericString
  493.  
  494.       shift types:
  495.           <SS>      Indicates single shift sequence
  496.           <LSL>      Indicates locking shift left sequence
  497.           <LSR>      Indicates locking shift right sequence
  498.  
  499.      example:
  500.       <LSL> \x1b \x28 \x4a; <LSL> \x1b \x28 \x42
  501.  
  502.  
  503. wc_encoding
  504.      Specifies an integer value for parsing wide-char
  505.      string.  It is used to determine the charset for each
  506.      wide character, after applying bit-and operation using
  507.      `wc_encoding_mask'.  This value should be unique in all
  508.      csN classes.
  509.  
  510. ct_encoding
  511.      Specifies a list of encoding information that can be
  512.      used for Compound Text.
  513.  
  514.  
  515. 6.  Sample of X Locale Database
  516.  
  517. The following is sample X Locale Database file.
  518.  
  519.  
  520.      #    $Xorg: LocaleDB.ms,v 1.3 2000/08/17 19:42:49 cpqbld Exp $
  521.      #    XLocale Database Sample for ja_JP.euc
  522.      #
  523.  
  524.  
  525.  
  526.                   5
  527.  
  528.  
  529.  
  530.  
  531.  
  532. X Locale Database Definition            X11, Release 6.4
  533.  
  534.  
  535.      #
  536.      #      XLC_FONTSET category
  537.      #
  538.      XLC_FONTSET
  539.      #      fs0 class (7 bit ASCII)
  540.      fs0  {
  541.       charset     ISO8859-1:GL
  542.       font         ISO8859-1:GL; JISX0201.1976-0:GL
  543.      }
  544.      #      fs1 class (Kanji)
  545.      fs1  {
  546.       charset     JISX0208.1983-0:GL
  547.       font         JISX0208.1983-0:GL
  548.      }
  549.      #      fs2 class (Half Kana)
  550.      fs2  {
  551.       charset     JISX0201.1976-0:GR
  552.       font         JISX0201.1976-0:GR
  553.      }
  554.      #      fs3 class (User Defined Character)
  555.      # fs3     {
  556.      #      charset     JISX0212.1990-0:GL
  557.      #      font         JISX0212.1990-0:GL
  558.      # }
  559.      END XLC_FONTSET
  560.  
  561.      #
  562.      #      XLC_XLOCALE category
  563.      #
  564.      XLC_XLOCALE
  565.  
  566.      encoding_name     ja.euc
  567.      mb_cur_max      3
  568.      state_depend_encoding    False
  569.  
  570.      wc_encoding_mask     \x00008080
  571.      wc_shift_bits     8
  572.  
  573.      #      cs0 class
  574.      cs0  {
  575.       side         GL:Default
  576.       length     1
  577.       wc_encoding     \x00000000
  578.       ct_encoding          ISO8859-1:GL; JISX0201.1976-0:GL
  579.      }
  580.      #      cs1 class
  581.      cs1  {
  582.       side         GR:Default
  583.       length     2
  584.  
  585.       wc_encoding     \x00008080
  586.  
  587.       ct_encoding          JISX0208.1983-0:GL; JISX0208.1983-0:GR;\
  588.              JISX0208.1983-1:GL; JISX0208.1983-1:GR
  589.  
  590.  
  591.  
  592.                   6
  593.  
  594.  
  595.  
  596.  
  597.  
  598. X Locale Database Definition            X11, Release 6.4
  599.  
  600.  
  601.      }
  602.  
  603.      #      cs2 class
  604.      cs2  {
  605.       side         GR
  606.       length     1
  607.       mb_encoding     <SS> \x8e
  608.  
  609.       wc_encoding     \x00000080
  610.  
  611.       ct_encoding          JISX0201.1976-0:GR
  612.      }
  613.  
  614.      #      cs3 class
  615.      # cs3     {
  616.      #      side         GL
  617.      #      length     2
  618.      #      mb_encoding     <SS> \x8f
  619.      # #if HasWChar32
  620.      #      wc_encoding     \x20000000
  621.      # #else
  622.      #      wc_encoding     \x00008000
  623.      # #endif
  624.      #      ct_encoding     JISX0212.1990-0:GL; JISX0212.1990-0:GR
  625.      # }
  626.  
  627.      END XLC_XLOCALE
  628.  
  629.  
  630. 7.  Reference
  631.  
  632.  
  633. [1] ISO/IEC 9899:1990 C Language Standard
  634.  
  635. [2] X Logical Font Descriptions
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.                   7
  659.  
  660.  
  661.