Convert::EastAsianWidth - Convert between full- and half-width characters
This document describes version 0.03 of Convert:EastAsianWidth, released October 3, 2003.
# Exports to_fullwidth() and to_halfwidth() by default use Convert::EastAsianWidth; 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.
Unicode::EastAsianWidth, charnames
Encode, Encode::compat
Autrijus Tang <autrijus@autrijus.org>
Copyright 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 Convert::EastAsianWidth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Convert::EastAsianWidth
CPAN shell
perl -MCPAN -e shell install Convert::EastAsianWidth
For more information on module installation, please visit the detailed CPAN module installation guide.