/usr.bin/mklocale/mklocale.1

https://bitbucket.org/freebsd/freebsd-head/ · Unknown · 304 lines · 304 code · 0 blank · 0 comment · 0 complexity · 7623150585815f3ba396a5c2c4bbcae7 MD5 · raw file

  1. .\" Copyright (c) 1993, 1994
  2. .\" The Regents of the University of California. All rights reserved.
  3. .\"
  4. .\" This code is derived from software contributed to Berkeley by
  5. .\" Paul Borman at Krystal Technologies.
  6. .\"
  7. .\" Redistribution and use in source and binary forms, with or without
  8. .\" modification, are permitted provided that the following conditions
  9. .\" are met:
  10. .\" 1. Redistributions of source code must retain the above copyright
  11. .\" notice, this list of conditions and the following disclaimer.
  12. .\" 2. Redistributions in binary form must reproduce the above copyright
  13. .\" notice, this list of conditions and the following disclaimer in the
  14. .\" documentation and/or other materials provided with the distribution.
  15. .\" 4. Neither the name of the University nor the names of its contributors
  16. .\" may be used to endorse or promote products derived from this software
  17. .\" without specific prior written permission.
  18. .\"
  19. .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  20. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22. .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  23. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  24. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  25. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  26. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  27. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  28. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  29. .\" SUCH DAMAGE.
  30. .\"
  31. .\" @(#)mklocale.1 8.2 (Berkeley) 4/18/94
  32. .\" $FreeBSD$
  33. .\"
  34. .Dd October 17, 2004
  35. .Dt MKLOCALE 1
  36. .Os
  37. .Sh NAME
  38. .Nm mklocale
  39. .Nd make LC_CTYPE locale files
  40. .Sh SYNOPSIS
  41. .Nm
  42. .Op Fl d
  43. .Ar "< src-file"
  44. .Ar "> language/LC_CTYPE"
  45. .Nm
  46. .Op Fl d
  47. .Fl o
  48. .Ar language/LC_CTYPE
  49. .Ar src-file
  50. .Sh DESCRIPTION
  51. The
  52. .Nm
  53. utility reads a
  54. .Dv LC_CTYPE
  55. source file from standard input and produces a
  56. .Dv LC_CTYPE
  57. binary file on standard output suitable for placement in
  58. .Pa /usr/share/locale/ Ns Ar language Ns Pa /LC_CTYPE .
  59. .Pp
  60. The format of
  61. .Ar src-file
  62. is quite simple.
  63. It consists of a series of lines which start with a keyword and have
  64. associated data following.
  65. C style comments are used
  66. to place comments in the file.
  67. .Pp
  68. Following options are available:
  69. .Bl -tag -width indent
  70. .It Fl d
  71. Turns on debugging messages.
  72. .It Fl o
  73. Specify output file.
  74. .El
  75. .Pp
  76. Besides the keywords which will be listed below,
  77. the following are valid tokens in
  78. .Ar src-file :
  79. .Bl -tag -width ".Ar literal"
  80. .It Dv RUNE
  81. A
  82. .Dv RUNE
  83. may be any of the following:
  84. .Bl -tag -width ".Ar 0x[0-9a-z]*"
  85. .It Ar 'x'
  86. The ASCII character
  87. .Ar x .
  88. .It Ar '\ex'
  89. The ANSI C character
  90. .Ar \ex
  91. where
  92. .Ar \ex
  93. is one of
  94. .Dv \ea ,
  95. .Dv \eb ,
  96. .Dv \ef ,
  97. .Dv \en ,
  98. .Dv \er ,
  99. .Dv \et ,
  100. or
  101. .Dv \ev .
  102. .It Ar 0x[0-9a-z]*
  103. A hexadecimal number representing a rune code.
  104. .It Ar 0[0-7]*
  105. An octal number representing a rune code.
  106. .It Ar [1-9][0-9]*
  107. A decimal number representing a rune code.
  108. .El
  109. .It Dv STRING
  110. A string enclosed in double quotes (").
  111. .It Dv THRU
  112. Either
  113. .Dv ...
  114. or
  115. .Dv - .
  116. Used to indicate ranges.
  117. .It Ar literal
  118. The follow characters are taken literally:
  119. .Bl -tag -width ".Dv <\|\|(\|\|["
  120. .It Dv "<\|(\|["
  121. Used to start a mapping.
  122. All are equivalent.
  123. .It Dv ">\|\^)\|]"
  124. Used to end a mapping.
  125. All are equivalent.
  126. .It Dv ":"
  127. Used as a delimiter in mappings.
  128. .El
  129. .El
  130. .Pp
  131. Key words which should only appear once are:
  132. .Bl -tag -width ".Dv PHONOGRAM"
  133. .It Dv ENCODING
  134. Followed by a
  135. .Dv STRING
  136. which indicates the encoding mechanism to be used for this locale.
  137. The current encodings are:
  138. .Bl -tag -width ".Dv MSKanji"
  139. .It Dv ASCII
  140. American Standard Code for Information Interchange.
  141. .It Dv BIG5
  142. The
  143. .Dq Big5
  144. encoding of Chinese.
  145. .It Dv EUC
  146. .Dv EUC
  147. encoding as used by several
  148. vendors of
  149. .Ux
  150. systems.
  151. .It Dv GB18030
  152. PRC national standard for encoding of Chinese text.
  153. .It Dv GB2312
  154. Older PRC national standard for encoding Chinese text.
  155. .It Dv GBK
  156. A widely used encoding method for Chinese text,
  157. backwards compatible with GB\ 2312-1980.
  158. .It Dv MSKanji
  159. The method of encoding Japanese used by Microsoft,
  160. loosely based on JIS.
  161. Also known as
  162. .Dq "Shift JIS"
  163. and
  164. .Dq SJIS .
  165. .It Dv NONE
  166. No translation and the default.
  167. .It Dv UTF-8
  168. The
  169. .Dv UTF-8
  170. transformation format of
  171. .Tn ISO
  172. 10646
  173. as defined by RFC 2279.
  174. .El
  175. .It Dv VARIABLE
  176. This keyword must be followed by a single tab or space character,
  177. after which encoding specific data is placed.
  178. Currently only the
  179. .Dv "EUC"
  180. encoding requires variable data.
  181. See
  182. .Xr euc 5
  183. for further details.
  184. .It Dv INVALID
  185. (obsolete)
  186. A single
  187. .Dv RUNE
  188. follows and is used as the invalid rune for this locale.
  189. .El
  190. .Pp
  191. The following keywords may appear multiple times and have the following
  192. format for data:
  193. .Bl -tag -width ".Dv <RUNE1 THRU RUNEn : RUNE2>" -offset indent
  194. .It Dv <RUNE1 RUNE2>
  195. .Dv RUNE1
  196. is mapped to
  197. .Dv RUNE2 .
  198. .It Dv <RUNE1 THRU RUNEn : RUNE2>
  199. Runes
  200. .Dv RUNE1
  201. through
  202. .Dv RUNEn
  203. are mapped to
  204. .Dv RUNE2
  205. through
  206. .Dv RUNE2
  207. + n-1.
  208. .El
  209. .Bl -tag -width ".Dv PHONOGRAM"
  210. .It Dv MAPLOWER
  211. Defines the tolower mappings.
  212. .Dv RUNE2
  213. is the lower case representation of
  214. .Dv RUNE1 .
  215. .It Dv MAPUPPER
  216. Defines the toupper mappings.
  217. .Dv RUNE2
  218. is the upper case representation of
  219. .Dv RUNE1 .
  220. .It Dv TODIGIT
  221. Defines a map from runes to their digit value.
  222. .Dv RUNE2
  223. is the integer value represented by
  224. .Dv RUNE1 .
  225. For example, the ASCII character
  226. .Ql 0
  227. would map to the decimal value 0.
  228. Only values up to 255
  229. are allowed.
  230. .El
  231. .Pp
  232. The following keywords may appear multiple times and have the following
  233. format for data:
  234. .Bl -tag -width ".Dv RUNE1 THRU RUNEn" -offset indent
  235. .It Dv RUNE
  236. This rune has the property defined by the keyword.
  237. .It Dv "RUNE1 THRU RUNEn"
  238. All the runes between and including
  239. .Dv RUNE1
  240. and
  241. .Dv RUNEn
  242. have the property defined by the keyword.
  243. .El
  244. .Bl -tag -width ".Dv PHONOGRAM"
  245. .It Dv ALPHA
  246. Defines runes which are alphabetic, printable and graphic.
  247. .It Dv CONTROL
  248. Defines runes which are control characters.
  249. .It Dv DIGIT
  250. Defines runes which are decimal digits, printable and graphic.
  251. .It Dv GRAPH
  252. Defines runes which are graphic and printable.
  253. .It Dv LOWER
  254. Defines runes which are lower case, printable and graphic.
  255. .It Dv PUNCT
  256. Defines runes which are punctuation, printable and graphic.
  257. .It Dv SPACE
  258. Defines runes which are spaces.
  259. .It Dv UPPER
  260. Defines runes which are upper case, printable and graphic.
  261. .It Dv XDIGIT
  262. Defines runes which are hexadecimal digits, printable and graphic.
  263. .It Dv BLANK
  264. Defines runes which are blank.
  265. .It Dv PRINT
  266. Defines runes which are printable.
  267. .It Dv IDEOGRAM
  268. Defines runes which are ideograms, printable and graphic.
  269. .It Dv SPECIAL
  270. Defines runes which are special characters, printable and graphic.
  271. .It Dv PHONOGRAM
  272. Defines runes which are phonograms, printable and graphic.
  273. .It Dv SWIDTH0
  274. Defines runes with display width 0.
  275. .It Dv SWIDTH1
  276. Defines runes with display width 1.
  277. .It Dv SWIDTH2
  278. Defines runes with display width 2.
  279. .It Dv SWIDTH3
  280. Defines runes with display width 3.
  281. .El
  282. .Pp
  283. If no display width explicitly defined, width 1 assumed
  284. for printable runes by default.
  285. .Sh SEE ALSO
  286. .Xr colldef 1 ,
  287. .Xr setlocale 3 ,
  288. .Xr wcwidth 3 ,
  289. .Xr big5 5 ,
  290. .Xr euc 5 ,
  291. .Xr gb18030 5 ,
  292. .Xr gb2312 5 ,
  293. .Xr gbk 5 ,
  294. .Xr mskanji 5 ,
  295. .Xr utf8 5
  296. .Sh HISTORY
  297. The
  298. .Nm
  299. utility first appeared in
  300. .Bx 4.4 .
  301. .Sh BUGS
  302. The
  303. .Nm
  304. utility is overly simplistic.