3
0

unicode.txt 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. Unicode support in busybox
  2. There are several scenarios where we need to handle unicode
  3. correctly.
  4. Shell input
  5. We want to correctly handle input of unicode characters.
  6. There are several problems with it. Just handling input
  7. as sequence of bytes would break any editing. This was fixed
  8. and now lineedit operates on the array of wchar_t's.
  9. But we also need to handle the following problematic moments:
  10. * It is unreasonable to expect that output device supports
  11. _any_ unicode chars. Perhaps we need to avoid printing
  12. those chars which are not supported by output device.
  13. Examples: chars which are not present in the font,
  14. chars which are not assigned in unicode,
  15. combining chars (especially trying to combine bad pairs:
  16. a_chinese_symbol + "combining grave accent" = ??!)
  17. * We need to account for the fact that unicode chars have
  18. different widths: 0 for combining chars, 1 for usual,
  19. 2 for ideograms (are there 3+ wide chars?).
  20. * Bidirectional handling. If user wants to echo a phrase
  21. in Hebrew, he types: echo "srettel werbeH"
  22. Editors (vi, ed)
  23. This case is a bit similar to "shell input", but unlike shell,
  24. editors may encounder many more unexpected unicode sequences
  25. (try to load a random binary file...), and they need to preserve
  26. them, unlike shell which can afford to drop bogus input.
  27. more, less
  28. Need to correctly display any input file. Ideally, with
  29. ASCII/unicode/filtered_unicode option or keyboard switch.
  30. Note: need to handle tabs and backspaces specially
  31. (bksp is for manpage compat).
  32. cut, fold, watch
  33. May need ability to cut unicode string to specified number of wchars
  34. and/or to specified screen width. Need to handle tabs specially.
  35. sed, awk, grep
  36. Handle unicode-aware regexp match
  37. ls (multi-column display)
  38. ls will fail to line up columnar output if it will not account
  39. for character widths (and maybe filter out some of them, see
  40. above). OTOH, non-columnar views (ls -1, ls -l, ls | car)
  41. should NOT filter out bad unicode (but need to filter out
  42. control chars (coreutils does that). Note that unlike more/less,
  43. tabs and backspaces need not special handling.
  44. top, ps
  45. Need to perform filtering similar to ls.
  46. Filename display (in error messages and elsewhere)
  47. Need to perform filtering similar to ls.
  48. TODO: write an email to Asmus Freytag (asmus@unicode.org),
  49. author of http://unicode.org/reports/tr11/