1package String::Multibyte::Big5Plus; 2 3use vars qw($VERSION); 4$VERSION = '1.12'; 5 6+{ 7 charset => 'Big-5 Plus', 8 9 regexp => '(?:[\x00-\x7F]|[\x81-\xFE][\x40-\x7E\x80-\xFE])', 10 11 cmpchar => sub { $_[0] cmp $_[1] }, 12 13 nextchar => sub { 14 my $ch = shift; 15 my $len = length $ch; 16 if ($len < 1 || 2 < $len) { 17 return undef; 18 } 19 elsif ($len == 1) { 20 return $ch eq "\x7F" 21 ? "\x81\x40" 22 : chr(ord($ch)+1); 23 } 24 else { 25 my($c, $d) = unpack('CC', $ch); 26 return $ch eq "\xFE\xFE" 27 ? undef 28 : $d == 0xFE 29 ? chr($c+1)."\x40" 30 : $d == 0x7E 31 ? chr($c)."\x80" 32 : pack('CC', $c, $d+1); 33 } 34 }, 35}; 36 37__END__ 38 39=head1 NAME 40 41String::Multibyte::Big5Plus - internally used by String::Multibyte 42for Big-5 Plus 43 44=head1 SYNOPSIS 45 46 use String::Multibyte; 47 48 $big5p = String::Multibyte->new('Big5Plus'); 49 $big5p_length = $big5p->length($big5p_string); 50 51=head1 DESCRIPTION 52 53C<String::Multibyte::Big5Plus> is used for manipulation of strings 54in Big-5 Plus. 55 56Byte range of single-byte characters: 57C<0x00..0x7F>. 58 59Leading byte range of double-byte characters: 60C<0x81..0xFE>. 61 62Trailing byte range of double-byte characters: 63C<0x40..0x7E> and C<0x80..0xFE>. 64 65Character order (invalid code points are excluded): 66C<0x00..0x7F>, C<0x8140..0xFEFE> 67 68=head1 SEE ALSO 69 70L<String::Multibyte> 71 72=cut 73