home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.26 / text0018.txt < prev    next >
Encoding:
Text File  |  1992-02-21  |  4.1 KB  |  73 lines

  1. Submitted-by: gwyn@smoke.brl.mil (Doug Gwyn)
  2.  
  3. In article <1991Nov25.182431.17201@uunet.uu.net> jfh@rpp386.cactus.org (John F Haugh II) writes:
  4. >I would say that POSIX completely ignored any codeset which was not
  5. >7-bit clean ASCII.  The simple issue of 8-bit code points being
  6. >mangled by ISTRIP is clear proof of this point.  The definition of
  7. >this function is in terms of bit widths, rather than character sizes.
  8. >Any 8-bit code set (such as the European character sets or even EBCDIC)
  9. >are mangled by the translation suggested by ISTRIP.
  10. >
  11. >I am certain that the various groups did give some thought to the
  12. >issue, but it really is pretty obvious that 1003.1 completely ignored
  13. >any system which uses 8 bit character sets.
  14. >
  15. >While 1003.1 was off inventing a new tty subsystem, it would have
  16. >been nice if they invented an interface for setting any locale-specific
  17. >traits of the tty system (a "tcsetlocale()" sort of deal) that would
  18. >provide for translations of locale-specific characters (the variously
  19. >accented vowels, for example) into something more POSIX-friendly.
  20.  
  21. How utterly off the mark can you be?  ISTRIP was not a POSIX invention;
  22. it was existing practice, as was the entire 8-bit byte orientation of
  23. the terminal device support (parity bits etc.)  If you need all 8 data
  24. bits for your terminal connection then simply don't specify ISTRIP to
  25. the terminal handler.  Unlike V7/BSD tty handlers that discard input
  26. when switching canonicalization modes, the 1003.1 model (like UNIX
  27. System V) doesn't demand such input flushing, making it suited just
  28. fine to a multibyte environment.  Keep in mind that multibyte characters
  29. are required by higher-level standards and conventions to be provided
  30. as byte streams, not single-text-character-representation chunks.  There
  31. could obviously be surprising effects when, for example, the user is
  32. trying to "erase" a just-typed text-character, not just the final byte
  33. of it, if the terminal handler does not understand the intention of the
  34. "erase" function, but that need to be dealt with at a lower level than
  35. the application/OS interface that 1003.1 specifies.
  36.  
  37. The 1003.1 terminal control functions are simply an interface to the
  38. underlying primitive operations provided by existing or future
  39. implementations, primarily those from UNIX System V augmented somewhat
  40. by support for BSD tty features.  The original draft 1003.1 had
  41. specified these as ioctl()s along the lines of existing practice,
  42. slanted toward the System V specifics with a few tweaks to accommodate
  43. BSD extensions (as opposed to being based on the V7/BSD tty ioctl()s).
  44. While that was the right blend of functionality, there were two main
  45. objections.  (1) It meant either wedging a separate-but-equal tty
  46. interface into the OS "kernel", which is effectively what a later
  47. release of BSD went ahead and did, or else "layering" an emulation of
  48. the POSIX ioctl() behavior around an existing but different tty ioctl(),
  49. along the lines of the BRL UNIX System V emulation for 4BSD.  People
  50. weren't terribly happy with either option.  (2) Handling terminal
  51. behavior via bit vectors and ioctl()s is awkward and error-prone; few
  52. applications I have seen get this entirely right.  Interfaces to allow
  53. the programmer to more directly and cleanly specify the desired actions
  54. are clearly needed, and since they didn't exist as part of existing
  55. commercial UNIX systems (every application programmer ended up rolling
  56. his own), devising a standard interface for this widely-but-varyingly-
  57. implemented facility was a positive service to the programmer.  There
  58. is nothing preventing you from continuing to use your existing kludges
  59. instead of the POSIX standard terminal control interface, but as a
  60. matter of improved portability you should probably change your local
  61. kludges to match the POSIX interface and use the vendor-provided
  62. version when it exists instead of replacing it with yours.  In the
  63. long run that should mean that you can stop having to deal with tty
  64. variations when porting software.
  65.  
  66. In summary, I think 1003.1 addressed the terminal control functionality
  67. sensibly and responsibly, and that there is no need for it to address
  68. the kinds of things that you seem to be talking about.
  69.  
  70.  
  71. Volume-Number: Volume 26, Number 20
  72.  
  73.