Unicode::EastAsianWidth - East Asian Width properties
This document describes version 1.02 of Unicode::EastAsianWidth, released October 3, 2003.
use Unicode::EastAsianWidth; $_ = chr(0x2588); # FULL BLOCK, an ambiguous-width character /\p{InEastAsianAmbiguous}/; # true /\p{InFullwidth}/; # false { local $Unicode::EastAsianWidth::EastAsian = 1; /\p{InFullwidth}/; # true; only works on perl 5.8+ }
This module provide user-defined Unicode properties that deals with East Asian character's width status, as specified in http://www.unicode.org/unicode/reports/tr11/.
It exports following functions to the caller's scope, to be used by Perl's Unicode matching system: InEastAsianFullwidth, InEastAsianHalfwidth, InEastAsianAmbiguous, InEastAsianNarrow InEastAsianWide, InEastAsianNeutral.
InEastAsianFullwidth
InEastAsianHalfwidth
InEastAsianAmbiguous
InEastAsianNarrow
InEastAsianWide
InEastAsianNeutral
According to the technical report listed above, two additional context-sensitive properties are exported: InFullwidth (union of Fullwidth and Wide) and InHalfwidth (union of Halfwidth, Narrow and Neutral).
InFullwidth
InHalfwidth
Ambiguous characters are treated by default as part of InHalfwidth, but you can modify this behaviour by assigning a true value to $Unicode::EastAsianWidth::EastAsian.
$Unicode::EastAsianWidth::EastAsian
Setting $Unicode::EastAsianWidth::EastAsian at run-time only works on Perl version 5.8 or above. Perl 5.6 users must use a BEGIN block to set it before the use statement:
use
BEGIN { $Unicode::EastAsianWidth::EastAsian = 1 } use Unicode::EastAsianWidth;
perlunicode, http://www.unicode.org/unicode/reports/tr11/
Autrijus Tang <autrijus@autrijus.org>
Copyright 2002, 2003 by Autrijus Tang <autrijus@autrijus.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install Unicode::EastAsianWidth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Unicode::EastAsianWidth
CPAN shell
perl -MCPAN -e shell install Unicode::EastAsianWidth
For more information on module installation, please visit the detailed CPAN module installation guide.