home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / std / internat / 1104 < prev    next >
Encoding:
Text File  |  1993-01-08  |  13.7 KB  |  269 lines

  1. Newsgroups: comp.std.internat
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!ames!agate!dog.ee.lbl.gov!hellgate.utah.edu!fcom.cc.utah.edu!cs.weber.edu!terry
  3. From: terry@cs.weber.edu (A Wizard of Earth C)
  4. Subject: Re: Dumb Americans (was INTERNATIONALIZATION: JAPAN, FAR EAST)
  5. Message-ID: <1993Jan8.051317.7820@fcom.cc.utah.edu>
  6. Keywords: Han Kanji Katakana Hirugana ISO10646 Unicode Codepages
  7. Sender: news@fcom.cc.utah.edu
  8. Organization: University of Utah Computer Center
  9. References: <1993Jan5.090747.29232@fcom.cc.utah.edu> <id.EAHW.92A@ferranti.com> <1993Jan7.033153.12133@fcom.cc.utah.edu> <1ii1dmINNcu6@rodan.UU.NET>
  10. Date: Fri, 8 Jan 93 05:13:17 GMT
  11. Lines: 256
  12.  
  13. In article <1ii1dmINNcu6@rodan.UU.NET>, avg@rodan.UU.NET (Vadim Antonov) writes:
  14. |> In article <1993Jan7.033153.12133@fcom.cc.utah.edu> terry@cs.weber.edu (A Wizard of Earth C) writes:
  15. |> >Consider a newline terminated text database containing fixed length lines,
  16. |> >or consider a database consisting of variant text records in fixed fields.
  17. |> 
  18. |> Databases with fixed-length fields deserve to loose.
  19.  
  20. This dictates coding practice, a no-no.  It is not a refutation of the point,
  21. only a statement of opinion on your part.
  22.  
  23. |> >In either case, the amount of data per field is now variant on Runic encoding.
  24. |> 
  25. |> In either case, the amount of data per field is now variant on ASCII encoding.
  26. |> I can store 'Terry Lambert' next to the 'Thelma Louis Maria Anna Bertran'.
  27. |> I alwasys thought that wizards think before speaking.
  28.  
  29. Your example is of two pieces of *information* of differring lengths,
  30. not a change in the amount of data potentially representable by the field.
  31. For instance, using Ken Thompsons FSS-UTF encoding from Plan 9, the amount
  32. of space taken by a single glyph is 1-6 bytes, depending on the ordinal
  33. value of each glyph within the set.
  34.  
  35. The problem is I have a fixed length field and/or storage.  Say I am storing
  36. English, Cyrillic, and Japanese text in a database with fixed field input
  37. and storage.  As discussed before, there are penalties in both places, so it
  38. is irrelevant if you eliminate the encoding in one location the other, if you
  39. do not do so in both.
  40.  
  41. I can store 24 7-bit ASCII glyphs, 12 11-bit Cyrillic glyphs (assume an
  42. encoding somewhere between 0x80 and 0x7ff.  No matter what encoding scheme
  43. is used, some character set will fall in that range, or worse), or 4 Kanji
  44. characters (assume a location between 0x4000000 and 0x7ffffff; it could be
  45. slightly better, although either Chinese or Japanese will get more characters
  46. per field, depending on who wins the argument over who's first lexically).
  47.  
  48. This is unacceptable for either a fixed input field in a database client,
  49. or for fixed field storage in a file system.  It absolutely rots for modern
  50. extent-based file systems, like vxfs (Veritas).
  51.  
  52. |> >Now consider a database, one of the primary methods of implementation being
  53. |> >memory mapped files.  Thus the storage and the in core representation must
  54. |> >be the same.
  55. |> 
  56. |> You can as well keep your stuff in runic encoding in memory. If you
  57. |> didn't know the virtual memory is the same ol' disk.
  58.  
  59. The problem occurs if one wants to simplify user-space processing of data;
  60. Runic encoding both places *is* possible (assuming a client-based decode for
  61. display), but is undesirable for the glyph-count limitations on fields.
  62.  
  63. |> >Now consider the mapping, which, by definition, must be done in the kernel,
  64. |> 
  65. |> Ever heard of user-lever file system servers?
  66.  
  67. Yes, I'm "a bit" familiar with the concept (hint: check my signature).  The
  68. problem is NFS mounts and backward compatability.  Also, you multiply your
  69. wire traffic from 1-7 times for Runic-encoded 32-bit values (as opposed to
  70. a constant 4 times for flat 32-bit encoding or a constant 2 times for flat
  71. 16-bit encoding -- or not at all, using compacted storage).
  72.  
  73. |> >(without proposing a localized per user or
  74. |> >per language file system view -- both Ohta and Vadim abhor "locale").
  75. |> 
  76. |> I do not abhor locale -- i flatly state that it is not sufficient for
  77. |> multilingual environments and Unicode/ISO10646 is too much for localizing
  78. |> where you can do everything *with* locale and 8-bit encoding (16 bit
  79. |> for Oriental languages using existing standards).
  80.  
  81. I disagree.  You can not make system localization the norm rather than
  82. application localization.  Addmittedly, application localization will still
  83. need to occur for cases such as word processing.
  84.  
  85. I have *never* suggested that "locale was sufficient" ... only a necessary
  86. part of the whole picture.
  87.  
  88. |> >Further suppose a distributed application with clients for the database
  89. |> >running on old and new hardware.  Only those datum with the same localization
  90. |> >as the (non-updated) client machine's software will be usable remotely.  A
  91. |> >potential example of this is available in OLTP for ticketing and reservation
  92. |> >systems for international airlines.
  93. |> 
  94. |> Now tell us how will you sort data from various locations with *local*
  95. |> sorting algorithms?
  96.  
  97. By locale tables.  I assume that if I have the fonts, I have the sorting
  98. tables.  I don't see a great deal of use in sorting in the application I
  99. suggested, in any case, since insertion is likely to be in sorted order
  100. rather than sorting the data each time it is displayed.  Insertion is done
  101. locally.
  102.  
  103. |> >Any COBOL program stores data in this fashion,  Many other programs store
  104. |> >data in this fashion to avoid a direct wire-translation of important values
  105. |> >by character encoding them in the files.  This allows a direct record seek
  106. |> >based on offset.  Many Ada programs also take advantage of this.
  107. |> 
  108. |> And some people never grow out of BASIC.
  109.  
  110. Some banking applications have legislation *requiring* their computations
  111. take place in decimal rather than binary.  Other than BCD, which is not a
  112. native computation mode for many processors (I know that the Intel chips and
  113. the IBM 360/370 are exceptions to this).  What do you do where storage by
  114. sign/exponent/mantissa isn't tolerable?
  115.  
  116. |> >Consider that Runic encoding is antithetical in terms of single character
  117. |> >changes for fixed record length files by virtue of it's ability to either
  118. |> >change record size (destroying the seek-offset record addressing) or by
  119. |> >changing the amount of data representable in a field (destroying the
  120. |> >ability to use fixed-length fields for input in the front end client).
  121. |> 
  122. |> I do not see why s/A/B/ should be different from s/A/AAA/.
  123. |> Fixed-length fields impose upper bounds on the length of the text;
  124. |> if you wan to be sure that every string contaiting N characters will fit
  125. |> into the field just reserve N*K bytes where K is the maximal length of
  126. |> rune. The field remains fixed-size.
  127.  
  128. But much larger, and wasteful of memory where it is stored in encoded format
  129. (be it disk or core).  The idea is not to ensure a fixed field size per se,
  130. but to ensure the *smallest possible* fixed field size.
  131.  
  132. If we consider our database application, this is unacceptable for even
  133. moderately large databases.
  134.  
  135. Also:  If I increase my field length to N*K bytes, iNf the minimal length of
  136. the rune is 1, then what prevents me from typing in N*K bytes of encoding 1
  137. into the field?  I still have a disparity between the amount of data I may
  138. enter, and the input mechanism is "prejudiced" based on language.
  139.  
  140. Of course, I could maintain a glyph count seperately from the field count,
  141. but the maintenance of external information defeats your arguments with
  142. regard to "all information in the set".  To calculate the length of the
  143. string to determine of I have exceeded the boundry, I will have to place
  144. some type of bounding (in excess of "length of field") on the input
  145. procedure, and re-check the length each time (unless I accept the concept
  146. of locale, or do it arithmetically based on placing each possible character
  147. set entirely within a fixed number of bytes per encoding (ie: All US ASCII
  148. characters take one byte, all Cyrillic, German and French two, all Tamil
  149. three, etc.); this is extremely awkward if we are to fit the idea into
  150. existing standards for display I/O (OpenLook, Motif, Athena, etc.).
  151.  
  152. |> >Consider the program that performs a fast record count based on a division
  153. |> >of the number of characters in a file by the *fixed* record size.
  154. |> 
  155. |> And what? You can do it with runic encoding as well.
  156.  
  157. Yes, if you accept the "N*K bytes" argument.  You will have to convince me
  158. of this first.
  159.  
  160. |> I'll discard the rest of the babble about fixed-sized fields for
  161. |> its obvious meaninglessness.
  162. |> 
  163. |> >There are a great many reasons to avoid Runic encoding, not the least of
  164. |> >which is that storage requirements are diminished to current levels for
  165. |> >all small glyph-set languages (<=256 characters) at the cost of local
  166. |> >attribution. 
  167. |> 
  168. |> >We must accept partial locale information for the input
  169. |> >mechanisms if nowhere else, and this provides a promiscuous tagging for
  170. |> >us at nearly 0 additional cost.
  171. |> 
  172. |> You'd have to change the semantic of Unix first. What do you think 
  173. |> cat of two files created within different locales should produce?
  174.  
  175. A single file in the "compound document" locale (with embedded "rich text"
  176. information) if the source files are not from the same locale; a single
  177. file with the same locale attribution as the sorce files if they are all
  178. from the same locale.
  179.  
  180. |> If you have a single locale for entire system the problem is non-existent
  181. |> as well as any necessity to use Unicode.
  182.  
  183. Not true.  It is a requirement with the size of the set that you propose
  184. that there be "localization" of some kind, if only to reduce the size of
  185. the character sets which must be downloaded to a display device.
  186.  
  187. |> >Attributed non-Runic encoding also buys us 2 bytes rather than 2-5 bytes
  188. |> >per glyph for large glyph-set languages (ie: Japanese).
  189. |> 
  190. |> The best runic encoding wastes 12.5% of space but wins over fixed-size
  191. |> characters on European languages greatly.
  192. |> UTF is space-inefficient for everything above ASCII.
  193.  
  194. This is true, if you don't do any further optimization (as in locale-based
  195. storage optimization for small glyph-set languages).  It is possible to
  196. optimize storage down to 8 bits for all small glyph-set languages with
  197. file attribution (or non-spacing language selection "tag" characters -- I
  198. am against in-band tagging, as it destroys file size information).  In this
  199. case, there is no 12.5% loss (12.5% is based on the assumption of a selected
  200. set of languages, not the full possible expansion set of all languages).
  201.  
  202. |> >Runic encoding has too many significant drawbacks, and the only penalty
  203. |> >on non-Runic encoding is +17% of disk space on an average UNIX system
  204. |> >(20% of the files on an average UNIX system are text files)
  205. |> 
  206. |> Even with that we have 3.4% (17%*20%) average wasted space.
  207.  
  208. Sorry; the 17% wasn't 17% of 20%, it was the an *additional* 17% on top of
  209. the 20% (ie: if 20% of your disk was taken up by your text files, now 37%
  210. is taken up using 16 bit encoding; this grows to 54% (17%*2+20%) for 32 bit
  211. raw storage.  This means users with an 80M drive, 16M is text.  This means
  212. you will need a 96.6M drive for the same contents with 16 bit encoding, or
  213. a 107.2M drive for 32 bit encoding.  The 17% is based on 3% of the stored
  214. characters being non-simply encodable (for instance, well known paths or
  215. well known data can not be renamed).  The original 20% is from another
  216. engineer, but I have no reason to doubt it's accuracy; if anything, it's low,
  217. since it doesn't include file names within directories.  This number will
  218. also go up with the use of message catalogs for localization (I expect error
  219. messages for commands to be in English), since there is not a just little
  220. text hard-coded within non-internationalized commands and applications, and
  221. I expect that this will have to change.
  222.  
  223. |> >for 16-bit
  224. |> >encoding, or +35% for 32-bit encoding,
  225. |> 
  226. |> Don't use UTF for 32-bit encoding, period.
  227.  
  228. This is raw 32 bit encoding (32 bits are stored as 32 bits without *any* Runic
  229. encoding);  UTF, of course, makes the nubers much, much worse.
  230.  
  231. |> >or 0% (with a space reduction and
  232. |> >a restoration of meaning to file, field, and record lengths for all
  233. |> >non-7-bit ASCII languages) with the assumption of a "locale" mechanism.
  234. |> 
  235. |> >PS: I notice that you, as well as Vadim, are dragging me from 386BSD
  236. |> >localization (in comp.unix.bsd) into a discussion of multinationalization
  237. |> >(in comp.std.internat).  It was not my intent to be involved in the
  238. |> >now distorted scope of this discussion when I started the news thread
  239. |> >"INTERNATIONALIZATION: JAPAN, FAR EAST" in comp.unix.bsd for discussion
  240. |> >of OS localization issues.  I hope you know what you are letting me in for.
  241. |> 
  242. |> OS *localization* does not require Unicode -- it was proven in practice
  243. |> many many times. The real issue is multinationalization.
  244.  
  245. I beg your pardon, but the subject line "INTERNATIONALIZATION: JAPAN, FAR EAST"
  246. comes from a discussion in comp.unix.bsd regarding the internationalization
  247. as a means of enabling localization for 386BSD.  internationalization as a
  248. means of providing a base for either localization or multinationalization is
  249. what Unicode is about.  Your suggestions deal with multinationalization only,
  250. and at least several of the suggegtions are unworkable for technological
  251. and/or political reasons.
  252.  
  253. I began the discussion "INTERNATIONALIZATION: JAPAN, FAR EAST" looking for an
  254. existing or draft standard for use in 386BSD localization and potential future
  255. multinationalization (no matter how grungy in implementation).  Usurping the
  256. subject doesn't change the original intent.  8-).
  257.  
  258.  
  259.                     Terry Lambert
  260.                     terry@icarus.weber.edu
  261.                     terry_lambert@novell.com
  262. ---
  263. Any opinions in this posting are my own and not those of my present
  264. or previous employers.
  265. -------------------------------------------------------------------------------
  266.                                         "I have an 8 user poetic license" - me
  267.  Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
  268. -------------------------------------------------------------------------------
  269.