| 1 |
wakaba |
1.1 |
package Char::Normalize::FullwidthHalfwidth; |
| 2 |
|
|
use strict; |
| 3 |
|
|
use utf8; |
| 4 |
|
|
|
| 5 |
|
|
our $VERSION=do{my @r=(q$Revision: 1.31 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r}; |
| 6 |
|
|
|
| 7 |
|
|
use Exporter; |
| 8 |
|
|
push our @ISA, 'Exporter'; |
| 9 |
|
|
|
| 10 |
|
|
our @EXPORT_OK = qw/normalize_width/; |
| 11 |
|
|
|
| 12 |
|
|
sub normalize_width ($) { |
| 13 |
|
|
my $sref = shift; |
| 14 |
|
|
$$sref =~ tr{\x{3000}\x{FF01}-\x{FF5E}\x{FF61}-\x{FF9F}\x{FFE0}-\x{FFE6}} |
| 15 |
|
|
{ !-~。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン\x{3099}\x{309A}\xA2\xA3\xAC\xAF\xA6\xA5\x{20A9}}; |
| 16 |
|
|
return $sref; |
| 17 |
|
|
} # normalize |
| 18 |
|
|
|
| 19 |
|
|
=head1 LICENSE |
| 20 |
|
|
|
| 21 |
|
|
Copyright 2008 Wakaba <[email protected]> |
| 22 |
|
|
|
| 23 |
|
|
This program is free software; you can redistribute it and/or |
| 24 |
|
|
modify it under the same terms as Perl itself. |
| 25 |
|
|
|
| 26 |
|
|
=cut |
| 27 |
|
|
|
| 28 |
|
|
1; |
| 29 |
|
|
## $Date: 2008/10/21 07:51:59 $ |