README 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. NAME
  2. Unicode::EastAsianWidth - East Asian Width properties
  3. VERSION
  4. This document describes version 1.10 of Unicode::EastAsianWidth,
  5. released October 14, 2007.
  6. SYNOPSIS
  7. use Unicode::EastAsianWidth;
  8. $_ = chr(0x2588); # FULL BLOCK, an ambiguous-width character
  9. /\p{InEastAsianAmbiguous}/; # true
  10. /\p{InFullwidth}/; # false
  11. {
  12. local $Unicode::EastAsianWidth::EastAsian = 1;
  13. /\p{InFullwidth}/; # true; only works on perl 5.8+
  14. }
  15. DESCRIPTION
  16. This module provide user-defined Unicode properties that deal with East
  17. Asian characters' width status, as specified in
  18. <http://www.unicode.org/unicode/reports/tr11/>.
  19. It exports the following functions to the caller's scope, to be used by
  20. Perl's Unicode matching system: "InEastAsianFullwidth",
  21. "InEastAsianHalfwidth", "InEastAsianAmbiguous", "InEastAsianNarrow"
  22. "InEastAsianWide", "InEastAsianNeutral".
  23. In accord to TR11 cited above, two additional context-sensitive
  24. properties are exported: "InFullwidth" (union of "Fullwidth" and "Wide")
  25. and "InHalfwidth" (union of "Halfwidth", "Narrow" and "Neutral").
  26. *Ambiguous* characters are treated by default as part of "InHalfwidth",
  27. but you can modify this behaviour by assigning a true value to
  28. $Unicode::EastAsianWidth::EastAsian.
  29. CAVEATS
  30. Setting $Unicode::EastAsianWidth::EastAsian at run-time only works on
  31. Perl version 5.8 or above. Perl 5.6 users must use a BEGIN block to set
  32. it before the "use" statement:
  33. BEGIN { $Unicode::EastAsianWidth::EastAsian = 1 }
  34. use Unicode::EastAsianWidth;
  35. SEE ALSO
  36. perlunicode, <http://www.unicode.org/unicode/reports/tr11/>
  37. AUTHORS
  38. Audrey Tang <cpan@audreyt.org>
  39. COPYRIGHT
  40. Copyright 2002, 2003, 2007 by Audrey Tang <cpan@audreyt.org>.
  41. This software is released under the MIT license cited below.
  42. The "MIT" License
  43. Permission is hereby granted, free of charge, to any person obtaining a
  44. copy of this software and associated documentation files (the
  45. "Software"), to deal in the Software without restriction, including
  46. without limitation the rights to use, copy, modify, merge, publish,
  47. distribute, sublicense, and/or sell copies of the Software, and to
  48. permit persons to whom the Software is furnished to do so, subject to
  49. the following conditions:
  50. The above copyright notice and this permission notice shall be included
  51. in all copies or substantial portions of the Software.
  52. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  53. OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  54. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  55. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  56. CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  57. TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  58. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.