README 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. #
  2. # $Id: README,v 1.33 2001/01/02 18:46:19 mleisher Exp $
  3. #
  4. MUTT UCData Package 2.5
  5. -----------------------
  6. This is a package that supports ctype-like operations for Unicode UCS-2 text
  7. (and surrogates), case mapping, decomposition lookup, and provides a
  8. bidirectional reordering algorithm. To use it, you will need to get the
  9. latest "UnicodeData-*.txt" (or later) file from the Unicode Web or FTP site.
  10. The character information portion of the package consists of three parts:
  11. 1. A program called "ucgendat" which generates five data files from the
  12. UnicodeData-*.txt file. The files are:
  13. A. case.dat - the case mappings.
  14. B. ctype.dat - the character property tables.
  15. C. comp.dat - the character composition pairs.
  16. D. decomp.dat - the character decompositions.
  17. E. cmbcl.dat - the non-zero combining classes.
  18. F. num.dat - the codes representing numbers.
  19. 2. The "ucdata.[ch]" files which implement the functions needed to
  20. check to see if a character matches groups of properties, to map between
  21. upper, lower, and title case, to look up the decomposition of a
  22. character, look up the combining class of a character, and get the number
  23. value of a character.
  24. 3. The UCData.java class which provides the same API (with minor changes for
  25. the numbers) and loads the same binary data files as the C code.
  26. A short reference to the functions available is in the "api.txt" file.
  27. Techie Details
  28. ==============
  29. The "ucgendat" program parses files from the command line which are all in the
  30. Unicode Character Database (UCDB) format. An additional properties file,
  31. "MUTTUCData.txt", provides some extra properties for some characters.
  32. The program looks for the two character properties fields (2 and 4), the
  33. combining class field (3), the decomposition field (5), the numeric value
  34. field (8), and the case mapping fields (12, 13, and 14). The decompositions
  35. are recursively expanded before being written out.
  36. The decomposition table contains all the canonical decompositions. This means
  37. all decompositions that do not have tags such as "<compat>" or "<font>".
  38. The data is almost all stored as unsigned longs (32-bits assumed) and the
  39. routines that load the data take care of endian swaps when necessary. This
  40. also means that supplementary characters (>= 0x10000) can be placed in the
  41. data files the "ucgendat" program parses.
  42. The data is written as external files and broken into six parts so it can be
  43. selectively updated at runtime if necessary.
  44. The data files currently generated from the "ucgendat" program total about 56K
  45. in size all together.
  46. The format of the binary data files is documented in the "format.txt" file.
  47. ==========================================================================
  48. The "Pretty Good Bidi Algorithm"
  49. --------------------------------
  50. This routine provides an alternative to the Unicode Bidi algorithm. The
  51. difference is that this version of the PGBA does not handle the explicit
  52. directional codes (LRE, RLE, LRO, RLO, PDF). It should now produce the same
  53. results as the Unicode BiDi algorithm for implicit reordering. Included are
  54. functions for doing cursor motion in both logical and visual order.
  55. This implementation is provided to demonstrate an effective alternate method
  56. for implicit reordering. To make this useful for an application, it probably
  57. needs some changes to the memory allocation and deallocation, as well as data
  58. structure additions for rendering.
  59. Mark Leisher <mleisher@crl.nmsu.edu>
  60. 19 November 1999
  61. -----------------------------------------------------------------------------
  62. CHANGES
  63. =======
  64. Version 2.5
  65. -----------
  66. 1. Changed the number lookup to set the denominator to 1 in cases of digits.
  67. This restores functional compatibility with John Cowan's UCType package.
  68. 2. Added support for the AL property.
  69. 3. Modified load and reload functions to return error codes.
  70. Version 2.4
  71. -----------
  72. 1. Improved some bidi algorithm documentation in the code.
  73. 2. Fixed a code mixup that produced a non-working version.
  74. Version 2.3
  75. -----------
  76. 1. Fixed a misspelling in the ucpgba.h header file.
  77. 2. Fixed a bug which caused trailing weak non-digit sequences to be left out of
  78. the reordered string in the bidi algorithm.
  79. 3. Fixed a problem with weak sequences containing non-spacing marks in the
  80. bidi algorithm.
  81. 4. Fixed a problem with text runs of the opposite direction of the string
  82. surrounding a weak + neutral text run appearing in the wrong order in the
  83. bidi algorithm.
  84. 5. Added a default overall direction parameter to the reordering function for
  85. cases of strings with no strong directional characters in the bidi
  86. algorithm.
  87. 6. The bidi API documentation was improved.
  88. 7. Added a man page for the bidi API.
  89. Version 2.2
  90. -----------
  91. 1. Fixed a problem with the bidi algorithm locating directional section
  92. boundaries.
  93. 2. Fixed a problem with the bidi algorithm starting the reordering correctly.
  94. 3. Fixed a problem with the bidi algorithm determining end boundaries for LTR
  95. segments.
  96. 4. Fixed a problem with the bidi algorithm reordering weak (digits and number
  97. separators) segments.
  98. 5. Added automatic switching of symmetrically paired characters when
  99. reversing RTL segments.
  100. 6. Added a missing symmetric character to the extra character properties in
  101. MUTTUCData.txt.
  102. 7. Added support for doing logical and visual cursor traversal.
  103. Version 2.1
  104. -----------
  105. 1. Updated the ucgendat program to handle the Unicode 3.0 character database
  106. properties. The AL and BM bidi properties gets marked as strong RTL and
  107. Other Neutral, the NSM, LRE, RLE, PDF, LRO, and RLO controls all get marked
  108. as Other Neutral.
  109. 2. Fixed some problems with testing against signed values in the UCData.java
  110. code and some minor cleanup.
  111. 3. Added the "Pretty Good Bidi Algorithm."
  112. Version 2.0
  113. -----------
  114. 1. Removed the old Java stuff for a new class that loads directly from the
  115. same data files as the C code does.
  116. 2. Fixed a problem with choosing the correct field when mapping case.
  117. 3. Adjust some search routines to start their search in the correct position.
  118. 4. Moved the copyright year to 1999.
  119. Version 1.9
  120. -----------
  121. 1. Fixed a problem with an incorrect amount of storage being allocated for the
  122. combining class nodes.
  123. 2. Fixed an invalid initialization in the number code.
  124. 3. Changed the Java template file formatting a bit.
  125. 4. Added tables and function for getting decompositions in the Java class.
  126. Version 1.8
  127. -----------
  128. 1. Fixed a problem with adding certain ranges.
  129. 2. Added two more macros for testing for identifiers.
  130. 3. Tested with the UnicodeData-2.1.5.txt file.
  131. Version 1.7
  132. -----------
  133. 1. Fixed a problem with looking up decompositions in "ucgendat."
  134. Version 1.6
  135. -----------
  136. 1. Added two new properties introduced with UnicodeData-2.1.4.txt.
  137. 2. Changed the "ucgendat.c" program a little to automatically align the
  138. property data on a 4-byte boundary when new properties are added.
  139. 3. Changed the "ucgendat.c" programs to only generate canonical
  140. decompositions.
  141. 4. Added two new macros ucisinitialpunct() and ucisfinalpunct() to check for
  142. initial and final punctuation characters.
  143. 5. Minor additions and changes to the documentation.
  144. Version 1.5
  145. -----------
  146. 1. Changed all file open calls to include binary mode with "b" for DOS/WIN
  147. platforms.
  148. 2. Wrapped the unistd.h include so it won't be included when compiled under
  149. Win32.
  150. 3. Fixed a bad range check for hex digits in ucgendat.c.
  151. 4. Fixed a bad endian swap for combining classes.
  152. 5. Added code to make a number table and associated lookup functions.
  153. Functions added are ucnumber(), ucdigit(), and ucgetnumber(). The last
  154. function is to maintain compatibility with John Cowan's "uctype" package.
  155. Version 1.4
  156. -----------
  157. 1. Fixed a bug with adding a range.
  158. 2. Fixed a bug with inserting a range in order.
  159. 3. Fixed incorrectly specified ucisdefined() and ucisundefined() macros.
  160. 4. Added the missing unload for the combining class data.
  161. 5. Fixed a bad macro placement in ucisweak().
  162. Version 1.3
  163. -----------
  164. 1. Bug with case mapping calculations fixed.
  165. 2. Bug with empty character property entries fixed.
  166. 3. Bug with incorrect type in the combining class lookup fixed.
  167. 4. Some corrections done to api.txt.
  168. 5. Bug in certain character property lookups fixed.
  169. 6. Added a character property table that records the defined characters.
  170. 7. Replaced ucisunknown() with ucisdefined() and ucisundefined().
  171. Version 1.2
  172. -----------
  173. 1. Added code to ucgendat to generate a combining class table.
  174. 2. Fixed an endian problem with the byte count of decompositions.
  175. 3. Fixed some minor problems in the "format.txt" file.
  176. 4. Removed some bogus "Ss" values from MUTTUCData.txt file.
  177. 5. Added API function to get combining class.
  178. 6. Changed the open mode to "rb" so binary data files will be opened correctly
  179. on DOS/WIN as well as other platforms.
  180. 7. Added the "api.txt" file.
  181. Version 1.1
  182. -----------
  183. 1. Added ucisxdigit() which I overlooked.
  184. 2. Added UC_LT to the ucisalpha() macro which I overlooked.
  185. 3. Change uciscntrl() to include UC_CF.
  186. 4. Added ucisocntrl() and ucfntcntrl() macros.
  187. 5. Added a ucisblank() which I overlooked.
  188. 6. Added missing properties to ucissymbol() and ucisnumber().
  189. 7. Added ucisgraph() and ucisprint().
  190. 8. Changed the "Mr" property to "Sy" to mark this subset of mirroring
  191. characters as symmetric to avoid trampling the Unicode/ISO10646 sense of
  192. mirroring.
  193. 9. Added another property called "Ss" which includes control characters
  194. traditionally seen as spaces in the isspace() macro.
  195. 10. Added a bunch of macros to be API compatible with John Cowan's package.
  196. ACKNOWLEDGEMENTS
  197. ================
  198. Thanks go to John Cowan <cowan@locke.ccil.org> for pointing out lots of
  199. missing things and giving me stuff, particularly a bunch of new macros.
  200. Thanks go to Bob Verbrugge <bob_verbrugge@nl.compuware.com> for pointing out
  201. various bugs.
  202. Thanks go to Christophe Pierret <cpierret@businessobjects.com> for pointing
  203. out that file modes need to have "b" for DOS/WIN machines, pointing out
  204. unistd.h is not a Win 32 header, and pointing out a problem with ucisalnum().
  205. Thanks go to Kent Johnson <kent@pondview.mv.com> for finding a bug that caused
  206. incomplete decompositions to be generated by the "ucgendat" program.
  207. Thanks go to Valeriy E. Ushakov <uwe@ptc.spbu.ru> for spotting an allocation
  208. error and an initialization error.
  209. Thanks go to Stig Venaas <Stig.Venaas@uninett.no> for providing a patch to
  210. support return types on load and reload, and for major updates to handle
  211. canonical composition and decomposition.