1Unicode::EastAsianWidthU(s3e)r Contributed Perl DocumentaUtniiocnode::EastAsianWidth(3)
2
3
4

NAME

6       Unicode::EastAsianWidth - East Asian Width properties
7

SYNOPSIS

9           use Unicode::EastAsianWidth;
10
11           $_ = chr(0x2010); # HYPHEN, an ambiguous-width character
12
13           /\p{InEastAsianAmbiguous}/; # True
14           /\p{InFullwidth}/;          # False
15
16       To mark ambiguous-width characters as InFullwidth:
17
18           BEGIN { $Unicode::EastAsianWidth::EastAsian = 1; }
19           use Unicode::EastAsianWidth;
20
21           $_ = chr(0x2010); # HYPHEN, an ambiguous-width character
22           /\p{InFullwidth}/;          # True
23

DESCRIPTION

25       This module provide user-defined Unicode properties that deal with
26       width status of East Asian characters, as specified in
27       <http://www.unicode.org/unicode/reports/tr11/>.
28
29       It exports the following functions to the caller's scope, to be used by
30       Perl's Unicode matching system: "InEastAsianFullwidth",
31       "InEastAsianHalfwidth", "InEastAsianAmbiguous", "InEastAsianNarrow"
32       "InEastAsianWide", "InEastAsianNeutral".
33
34       In accord to TR11 cited above, two additional context-sensitive
35       properties are exported: "InFullwidth" (union of "Fullwidth" and
36       "Wide") and "InHalfwidth" (union of "Halfwidth", "Narrow" and
37       "Neutral").
38
39       Ambiguous characters are treated by default as part of "InHalfwidth",
40       but you can modify this behaviour by assigning a true value to
41       $Unicode::EastAsianWidth::EastAsian at compile time within a "BEGIN"
42       block before loading this module:
43
44           BEGIN { $Unicode::EastAsianWidth::EastAsian = 1; }
45           use Unicode::EastAsianWidth;
46
47       Setting $Unicode::EastAsianWidth::EastAsian at run-time used to work on
48       Perl versions between 5.8 and 5.14 due to an implementation detail, but
49       it will no longer work on Perl 5.16 and later versions, and hence is
50       not recommended.
51

SEE ALSO

53       perlunicode, <http://www.unicode.org/unicode/reports/tr11/>
54

AUTHORS

56       Audrey Tang <cpan@audreyt.org>
57

LICENSE

59       This work is under the CC0 1.0 Universal license.
60
61       To the extent possible under law, 唐鳳 has waived all copyright and
62       related or neighboring rights to Unicode-EastAsianWidth.
63
64       This work is published from Taiwan.
65
66       <http://creativecommons.org/publicdomain/zero/1.0>
67
68
69
70perl v5.36.0                      2023-01-20        Unicode::EastAsianWidth(3)
Impressum