Encode-Arabic
view release on metacpan or search on metacpan
lib/Encode/Arabic.pm view on Meta::CPAN
use Encode::Arabic::ArabTeX::Verbatim;
use Encode::Arabic::ArabTeX::ZDMG;
use Encode::Arabic::ArabTeX::ZDMG::RE;
use Encode::Arabic::Buckwalter;
use Encode::Arabic::Parkinson;
use Encode::Arabic::Habash;
sub enmode ($@) {
my $enc = shift;
my $obj = Encode::find_encoding($enc);
croak "Unknown encoding '$enc'" unless defined $obj;
$obj->enmode(@_);
}
sub demode ($@) {
my $enc = shift;
my $obj = Encode::find_encoding($enc);
croak "Unknown encoding '$enc'" unless defined $obj;
$obj->demode(@_);
}
1;
__END__
=head1 NAME
Encode::Arabic - Encodings of Arabic
=head1 SYNOPSIS
use Encode::Arabic; # imports just like 'use Encode' even with options would
while ($line = <>) { # renders the ArabTeX notation for Arabic both in the ..
print encode 'utf8', decode 'arabtex', $line; # .. Arabic script proper and the
print encode 'utf8', decode 'arabtex-zdmg', $line; # .. Latin phonetic transcription
}
# 'use Encode::Arabic ":modes"' would export the functions controlling the conversion modes
Encode::Arabic::demode 'arabtex', 'default';
Encode::Arabic::enmode 'buckwalter', 'full', 'xml', 'strip off kashida';
# Arabic in lower ASCII transliterations <--> Arabic script in Perl's internal encoding
$string = decode 'ArabTeX', $octets;
$octets = encode 'Buckwalter', $string;
$string = decode 'Buckwalter', $octets;
$octets = encode 'ArabTeX', $string;
# Arabic in lower ASCII transliterations <--> Latin phonetic transcription, Perl's utf8
$string = decode 'Buckwalter', $octets;
$octets = encode 'ArabTeX', $string;
$string = decode 'ArabTeX-ZDMG', $octets;
$octets = encode 'utf8', $string;
=head1 DESCRIPTION
This module is a wrapper for various implementations of the encoding systems used for the Arabic
language and covering even some non-Arabic extensions to the Arabic script. The included modules
fit in the philosophy of L<Encode::Encoding|Encode::Encoding> and can be used directly with the
L<Encode|Encode> module.
=head2 LIST OF ENCODINGS
=over
=item ArabTeX
ArabTeX multi-character notation for Arabic / Perl's internal format for the Arabic script
L<Encode::Arabic::ArabTeX|Encode::Arabic::ArabTeX>,
uses L<Encode::Mapper|Encode::Mapper>
=item ArabTeX-RE
Deprecated method using sequential regular-expression substitutions. Limited in scope over the
ArabTeX notation and non-efficient in data processing, still, not requiring the
L<Encode::Mapper|Encode::Mapper> module.
L<Encode::Arabic::ArabTeX::RE|Encode::Arabic::ArabTeX::RE>
=item ArabTeX-Verbatim
ArabTeX multi-character I<verbatim> notation for Arabic / Perl's internal format for the Arabic script
L<Encode::Arabic::ArabTeX::Verbatim|Encode::Arabic::ArabTeX::Verbatim>,
uses L<Encode::Mapper|Encode::Mapper>
=item ArabTeX-ZDMG
ArabTeX multi-character notation for Arabic / Perl's internal format for the Latin phonetic
trascription in the ZDMG style
L<Encode::Arabic::ArabTeX::ZDMG|Encode::Arabic::ArabTeX::ZDMG>,
uses L<Encode::Mapper|Encode::Mapper>
=item ArabTeX-ZDMG-RE
Deprecated method using sequential regular-expression substitutions. Limited in scope over the
ArabTeX notation and non-efficient in data processing, still, not requiring the
L<Encode::Mapper|Encode::Mapper> module.
L<Encode::Arabic::ArabTeX::ZDMG::RE|Encode::Arabic::ArabTeX::ZDMG::RE>
=item Buckwalter
( run in 1.267 second using v1.01-cache-2.11-cpan-71847e10f99 )