line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package String::Multibyte::Big5; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
8
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
268
|
|
4
|
|
|
|
|
|
|
$VERSION = '1.02'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
+{ |
7
|
|
|
|
|
|
|
charset => 'Big-5', |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
regexp => '(?:[\x00-\x7F]|[\x81-\xFE][\x40-\x7E\xA1-\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)."\xA1" |
32
|
|
|
|
|
|
|
: pack('CC', $c, $d+1); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
}, |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |