'CB','=cbeta',
'CDP','=big5-cdp',
'GT','=gt',
- 'GT-K','=gt',
+ 'GT-K','=gt-k',
'HZK1','=hanziku-1',
'HZK2','=hanziku-2',
'HZK3','=hanziku-3',
'M','=daikanwa',
);
+my $er_prefix_re=join '|', keys %er_alias;
+
if(-d "$DB_HOME/character"){
for (glob "$DB_HOME/character/feature/*"){
next if(/\.txt$/);
sub de_er{
my($er)=@_;
my($output_char,$atr,$value);
- my $keys = join '|', keys %er_alias;
if($er=~/^\d+$/){
$output_char=pack("U",$er);
}elsif($er=~/^U[\+\-]([a-fA-F\d]+)/){
$output_char=pack("U",hex($1));
- }elsif($er=~/(?:I\-)?($keys)\-?([0-9a-fA-F]+)/){
+ }elsif($er=~/(?:I\-)?($er_prefix_re)\-?([0-9a-fA-F]+)/){
($atr,$value)=($1,$2);
unless($er_alias{$atr}=~/daikanwa|gt/){
$value=hex($value);