The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Unicode::EastAsianWidth - East Asian Width properties

VERSION

This document describes version 1.02 of Unicode::EastAsianWidth, released October 3, 2003.

SYNOPSIS

    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+
    }

DESCRIPTION

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.

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).

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.

CAVEATS

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:

        BEGIN { $Unicode::EastAsianWidth::EastAsian = 1 }
        use Unicode::EastAsianWidth;

SEE ALSO

perlunicode, http://www.unicode.org/unicode/reports/tr11/

AUTHORS

Autrijus Tang <autrijus@autrijus.org>

COPYRIGHT

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