home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / std / internat / 1119 < prev    next >
Encoding:
Internet Message Format  |  1993-01-09  |  6.8 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!dptg!ulysses!allegra!alice!andrew
  2. From: andrew@alice.att.com (Andrew Hume)
  3. Newsgroups: comp.std.internat
  4. Subject: Re: Dumb Americans (was INTERNATIONALIZATION: JAPAN, FAR EAST)
  5. Keywords: Han Kanji Katakana Hirugana ISO10646 Unicode Codepages
  6. Message-ID: <24579@alice.att.com>
  7. Date: 9 Jan 93 07:51:57 GMT
  8. Article-I.D.: alice.24579
  9. References: <id.EAHW.92A@ferranti.com> <1993Jan7.033153.12133@fcom.cc.utah.edu> <1993Jan9.024546.26934@fcom.cc.utah.edu>
  10. Organization: AT&T Bell Laboratories, Murray Hill NJ
  11. Lines: 119
  12.  
  13. In article <1993Jan9.024546.26934@fcom.cc.utah.edu>, terry@cs.weber.edu (A Wizard of Earth C) writes:
  14. ~ In article <1993Jan8.092754.6344@prl.dec.com> boyd@prl.dec.com (Boyd Roberts) writes:
  15. ~ >Using Plan 9 utf you know the maximum size in bytes that a Rune can
  16. ~ >be encoded into.  Fixed fields only have to be a multiple of this value,
  17. ~ >defined to be to be UTFmax.  So where's the problem?
  18. ~ [ First a clarification of something which is my fault because of my
  19. ~   background in comm software:  I have been informed that the currently
  20. ~   "blessed" correct terminlogy for what I have been calling "Runic
  21. ~   encoding" is "Process code", "File code", or "Interchange code".  I'll
  22. ~   try to call it "Interchange code" from now on (I feel the other terms
  23. ~   imply applications, some of which I disagree with). ]
  24. ~ A good question.  The answer is fourfold:
  25. ~ 1)    The field length is still not descriptive of the number of
  26. ~     characters a field may contain; you have only set a minimum
  27. ~     "maximum character count".  It is still possible to enter
  28. ~     in more characters in a non-maximally encoded character set
  29. ~     than this value, unless you adopt the abstraction of a
  30. ~     maximum character count seperate from the maximum necessary
  31. ~     storage length.  The maximum character count is what we
  32. ~     would normally think of as the displayed field length (ie:
  33. ~     what you see as the size of an input box).  If my field
  34. ~     length is 6 bytes times the maximum record length for 31
  35. ~     bits (as with UTF encoding), would I not be better off using
  36. ~     raw 32 bit encoding, yielding only 4 times the maximum
  37. ~     record length for the same data (or only 2 times for 16 bit
  38. ~     data)?
  39.  
  40.         what objective function are you maximising? frankly,
  41.     if i were doing fixed records, i would keep char/byte counts.
  42.     the reason to use UTF is precisely system-independence (see below).
  43.     if density is an issue (it rarely is for us), then i agree --
  44.     16bit encodings save you space for kanji.
  45.  
  46. ~ 2)    A database application with memory mapped I/O for both the
  47. ~     front and back ends can not keep a consistant coding for
  48. ~     data throughout the application.  If I memory map a UTF
  49. ~     file, conversion is required before searches.  This will
  50. ~     either have to be done at search time, or will have to be
  51. ~     done via non-UTF encoded cache buffers within each database
  52. ~     engine (there may be several for a single database).  This
  53. ~     is wasteful of user-space memory and requires additional
  54. ~     swapping of pages for the user-space cache implementation.
  55. ~     Further, UTF encoded data must be converted into some
  56. ~     native representation before it can be written to display
  57. ~     memory if memory mapped output is used.
  58.  
  59.         as it turns out, MANY (but not all) applications can
  60.     work quite well on the UTF-encoded text. mostly, apps search
  61.     for literal strings, and all that happens is that their length
  62.     increases a little. our experience in plan 9 is that relatively
  63.     few applications do enough that it is more efficient to convert
  64.     to Runes before processing.
  65.  
  66. ~ 3)    If UTF is used for internal encoding in the application,
  67. ~     (such as would be necessary for direct use of memory mapped
  68. ~     files), then you have a dilemma: the natural input mechanism
  69. ~     into such a system is also UTF encoded data.  This means that
  70. ~     either the device must directly supply UTF encoded data (a
  71. ~     problem, in that the reson the memory-mapped files are UTF in
  72. ~     user space is our reluctance to do translation to and from
  73. ~     UTF within the kernel), or each application must carry around
  74. ~     it's own raw-input-to-UTF-conversion code.  This enlareges the
  75. ~     size of the application.  Note that this conversion code is
  76. ~     not "already there" if the native processing mode for an
  77. ~     application is UTF, since other conversions would not take
  78. ~     place.
  79.  
  80.         ahhh, therein lies the nub! Plan 9 is UTF all the way
  81.     through. by and large, the problem with this approach for
  82.     unix systems should only be in the moral equivalent of teh tty driver.
  83.     once characters are entered, everything is just UTF. the OS
  84.     and libraries and compilers and ... all need to be recompiled
  85.     with care. this is not as bad as it seems but is a lot of fussing.
  86.     on the other hand, ascii systems are there already!
  87.  
  88. ~ 4)    Backward comatability with existing systems requires the ability
  89. ~     to crossmount using existing mechanisms (NFS, RFS, etc.).  How
  90. ~     can this be supported without kernel code, when the remote
  91. ~     system is ignorant of UTF deencoding?  With kernel code, what
  92. ~     is the purpose in using the UTF encoding as the native processing
  93. ~     mode in the application?
  94.  
  95.         well, if the existing remote systems are just ascii,
  96.     then you have no problem. by and large, everything just works
  97.     (if your system is 8-bit clean). if the remote systems are
  98.     (and remain) non-ascii, then you have problems. the purpose
  99.     (at least in plan 9) of teh kernel using UTF is that the entire
  100.     system uses UTF -- all text strings are 10646 chars UTf encoded into
  101.     a byte stream.
  102.  
  103. ~ There are workarounds to these, but they are much uglier than compact
  104. ~ storage processing, where storage is done in a locale-specific set if
  105. ~ possible.  This would also allow a business to convert relatively
  106. ~ painlessly by leveraging current investments in prior localization
  107. ~ technology.
  108.  
  109.     i'd be the first to admit the plan 9 approach has its
  110. difficulties. however, there is a nice coherence to the system
  111. that applies to everything it connects to. i am unimpressed with
  112. the alternative you suggest (although i admire the length and thoroughness
  113. you have shown in discussing it) because it seems to me like
  114. ``here is an island, there is an island, interchange is a bitch''.
  115. all interchange must be explicitly typed and converted on system
  116. boundaries. and i have no idea how you do that. you can't convert
  117. binaries, just text; but how do you tell the difference? and how
  118. do you recognise system boundaries? (for example, when i mount
  119. a remote system's files, i may be getting several systems' files;
  120. how doe sthe file server know which ones to convert and how?
  121. plan 9 is inherently very distributed and so we see
  122. the difficulties of teh island approach earlier or more clearly.
  123. on the other hand, i'd be the last person to advocate massive system
  124. upheavals just for the sake of using 10646. if you are willing to be
  125. an island, and for many systems it may be the practical choice, then
  126. all power to you.
  127.  
  128.         andrew
  129.