, keys %_Z2H);
#$_PAT_Z2D    = join("|", keys %_Z2D);

sub h2z {
    no warnings qw(uninitialized);
    my $r_str          = shift;
    my ($keep_dakuten) = @_;
    my $n              = 0;
    unless ($keep_dakuten) {
        $n = (
            $$r_str =~ s(
               ($RE{EUC_KANA}
                (?:\x8e[\xde\xdf])?)
               ){
          my $str = $1;
          $_D2Z{$str} || $_H2Z{$str} || 
              # in case dakuten and handakuten are side-by-side!
              $_H2Z{substr($str,0,2)} . $_H2Z{substr($str,2,2)};
          }eogx
        );
    }
    else {
        $n = (
            $$r_str =~ s(
               ($RE{EUC_KANA})
               ){
          $_H2Z{$1};
          }eogx
        );
    }
    $n;
}

sub z2h {
    my $r_str = shift;
    my $n     = (
        $$r_str =~ s(
              ($RE{EUC_C}|$RE{EUC_0212}|$RE{EUC_KANA})
              ){
         $_Z2D{$1} || $_Z2H{$1} || $1;
         }eogx
    );
    $n;
}

1;
__END__


=head1 NAME

Encode::JP::H2Z -- internally used by Encode::JP::2022_JP*

=cut
