Convert::EastAsianWidth 0.03 reviewDownload
Convert::EastAsianWidth is a Perl module that can convert between full- and half-width characters. SYNOPSIS # Exports to_fu
Convert::EastAsianWidth is a Perl module that can convert between full- and half-width characters.
# Exports to_fullwidth() and to_halfwidth() by default
my $u = to_fullwidth('ABC'); # Full-width variant of 'ABC'
my $b = to_fullwidth('ABC', 'big5'); # Ditto, but in big5 encoding
my $x = to_halfwidth($u); # Gets back 'ABC'
my $y = to_halfwidth($b, 'big5'); # Same as above
This module uses the regular expression properties provided by Unicode::EastAsianWidth to efficiently convert between full- and half-width characters.
The first argument is the string to be converted; the second one represents the input and encodings. If omitted, both are assumed by to Unicode strings.
In Perl versions before 5.8, Encode::compat is required for the encoding conversion function to work.
Convert::EastAsianWidth 0.03 keywords