home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.29 / text0010.txt < prev    next >
Encoding:
Text File  |  1992-12-26  |  4.4 KB  |  83 lines

  1. Submitted-by: gwyn@smoke.brl.mil (Doug Gwyn)
  2.  
  3. In article <16p6g6INNs4i@ftp.UU.NET> thorinn@diku.dk (Lars Henrik Mathiesen) writes:
  4. >Why is it so bad that Unicode is not like earlier ``extended
  5. >encodings''? Existing code is a large problem, of course, but what is
  6. >the problem relative to Standard C itself? The standard provides both
  7. >wide and multibyte characters, and Unicode happens to fit the former
  8. >definition instead of the latter.
  9.  
  10. And that's the problem.  Unicode appears to be intended for use in
  11. external text objects, such as disk files.  The only way an
  12. implementation could simultaneously conform to the C standard and
  13. to 10646 used for external storage representation would be for it
  14. to make char (NOT just wchar_t) 16 bits wide.  While that suffices
  15. in theory, it was the desire to implement char as an 8-bit byte
  16. object type regardless of character set needs that led to the
  17. adoption of the multibyte character encoding model for IS 9899 (C
  18. standard) over alternate proposals, one sponsored by ITSCJ and one
  19. sponsored by just me, that would have made character and byte object
  20. types both basic data types in C, with standard I/O functions
  21. dealing with the most appropriate type (e.g. fread() would get bytes
  22. while fscanf() would get characters).  The observation was made that
  23. all significant character set encodings at the time could be
  24. accommodated within the multibyte sequence model; that was an
  25. important factor in deciding on the model adopted for Standard C.
  26.  
  27. The point is that these issues were thoroughly discussed in /usr/group
  28. and X/Open internationalization working groups, members of which (as
  29. well as Japanese who had already amassed considerable practical
  30. experience in this area) then assisted during X3J11/WG14 deliberations
  31. that adopted the multibyte approach.  Yes, other, conceptually cleaner
  32. models are possible, but they were considered and deliberately
  33. rejected in favor of the external:multibyte/internal:wchar_t model.
  34. X3.159-1989/IS 9899:1990 was the first major programming language
  35. standard to tackle internationalization issues, and it was not done
  36. in isolation but rather with extensive liaison with those working the
  37. problem at the time.  Therefore, it is important for others now trying
  38. to work in the same areas to (a) fully understand and (b) cooperate
  39. with this existing standard model.  From what I have seen, ISO 10646
  40. failed on both counts (a) and (b), so now we do have a practical
  41. programming problem.
  42.  
  43. >  2) For the programmer, it seems easier to just use wchar_t strings;
  44.  
  45. But he CAN'T -- there is no standard way to convert from external
  46. Unicode to internal wchar_t!  (Unless char is made 16 bits wide,
  47. which many C vendors have said is not feasible for their clients.)
  48. (The root problem is that there are 0-valued "bytes" within the
  49. Unicode character set.)
  50.  
  51. >  3) There is a problem in that the standard defines wide character
  52. >  constants and wide string literals in terms of multibyte characters.
  53.  
  54. There is no problem there, and it's not relevant to the issue anyway;
  55. perhaps you don't understand the intent of this part of the standard.
  56.  
  57. >If the problem is that POSIX wants to insist on a subset of Standard
  58. >C, or C bindings for some system functionality, that cannot work with
  59. >Unicode; then I have very little sympathy: The direction that Unicode
  60. >was taking must have been clear well before anything within POSIX was
  61. >finalized, and disregarding it may well turn out to have been, let's
  62. >say, infelicitous.
  63.  
  64. I cannot express how angry such a statement makes me.  The prior art
  65. here is that which was adopted into the C standard, not Unicode which
  66. came later.  During the Unicode evolution it was very fluid, for
  67. example at one point using non-0-valued bytes for the "padding".
  68. When the Unicode proposal started heading in a direction that would
  69. cause incompatibilities with the established multibyte encoding model,
  70. attempts were made to bring this to the attention of the DIS 10646
  71. developers so that it could be remedied before any harm was done.
  72. Reports from those involved were that all such suggestions were
  73. denounced as intrusion on 10646's turf, and that the rest of the world
  74. should change to accommodate the forthcoming IS 10646 rather than the
  75. character set standard being compatible with existing practice.  Why
  76. 10646 would ever have been approved by the International Standards
  77. Organization under such circumstances I don't know, but it must have
  78. been for political reasons since technically it is an immense mistake.
  79.  
  80.  
  81. Volume-Number: Volume 29, Number 11
  82.  
  83.