home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / bsd / 8991 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  2.5 KB

  1. Path: sparky!uunet!mcsun!uknet!yorkohm!minster!forsyth
  2. From: forsyth@minster.york.ac.uk
  3. Newsgroups: comp.unix.bsd
  4. Subject: multibyte character representations and Unicode
  5. Message-ID: <721993836.11625@minster.york.ac.uk>
  6. Date: 17 Nov 92 09:50:36 GMT
  7. Organization: Department of Computer Science, University of York, England
  8. Lines: 42
  9.  
  10. Terry Weber suggests that half one's disc space will vanish
  11. on adopting Unicode.  Not so: I draw your attention to Plan 9,
  12. which uses Unicode very successfully.  See the Plan 9 documentation
  13. on research.att.com (dist/plan9doc, I think).
  14.  
  15. Basically, there is a multibyte encoding for Unicode that works well.
  16. Inside relatively FEW programs the multibyte encoding is converted
  17. to an integer representation (the type `Rune') to simplify manipulation.
  18. For instance, the text displayed in a text frame by sam or the window
  19. manager is kept as Runes, but ONLY the text displayed.  Any hidden
  20. text -- and text in disc files -- is kept in the multibyte encoding.
  21.  
  22. Some care is required in specifying the multibyte encoding.
  23. It seems that Plan 9 originally followed the encoding specified in
  24. the Unicode standard, but it has some messy consequences in practice:
  25. not least that the 2nd and 3rd bytes can appear to be valid
  26. ASCII.  (Why anyone would design an encoding that does this is beyond
  27. me, since the problems are fairly obvious, but that's what Unicode did.)
  28. Eventually Plan 9 switched to a new encoding -- which apparently has now been
  29. proposed for use in ISO 10646 -- that lacks all the unfortunate features.
  30. The second and third bytes of the encoding do not look like ASCII characters.
  31. (All bytes of an encoded character have the 0x80 bit set.)
  32. The consequence is that even fewer programs are affected:
  33. most pass Unicode encodings straight through.
  34.  
  35. In particular, the `normal' file system names can hold Unicode
  36. characters without fuss.  There is certainly no need to switch to 16-bit
  37. representations for them, with all that that entails.
  38.  
  39. Actually, on Plan 9 you cannot even run the window manager without using
  40. Unicode: it's name is `eight and a half' (ie, 8 followed by a 1/2 symbol!),
  41. entered as `8 ALT 1 2' (on my keyboard, anyhow).
  42.  
  43. You can find much of the Plan 9 Rune support in
  44. the source for Pike's editor `sam', also on research.att.com
  45. (dist/sam, i think).
  46. (You also get a very decent editor, a library that gives you a sane
  47. interface to X11, and a library for managing text on a bitmap display.)
  48.  
  49. Obviously programs can store Runes in disc files if that's really what
  50. they need, or if their authors work for disc manufacturers, but it
  51. isn't necessary.
  52.