Encode::Arabic(3pm)
π Encode::Arabic π
okay bestie, gather round, because we're talking about the Perl module for Arabic encodings β Encode::Arabic. That's the whole NAME situation: Encodings of Arabic. Short, iconic, does exactly what it says. π
β¨ 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;
πΈ DESCRIPTION πΈ
So basically, this module is a lil wrapper β a very cute, very capable wrapper β around a bunch of different implementations of the encoding systems used for the Arabic language. And it doesn't stop at Arabic proper either: it covers even some non-Arabic extensions to the Arabic script. π
The modules it bundles fit right into the philosophy of Encode::Encoding, which means you can use them directly with the Encode module. No weird middleman behaviour. Slay.
π¦ LIST OF ENCODINGS π¦
Each of these is a whole vibe, so let's go one by one:
- ArabTeX β the ArabTeX multi-character notation for Arabic on one side, Perl's internal format for the Arabic script on the other. Powered by
Encode::Arabic::ArabTeX, and it usesEncode::Mapper. - ArabTeX-RE β bestie, heads up: this one is deprecated. It's the method using sequential regular-expression substitutions. Limited in scope compared to the full ArabTeX notation, and non-efficient when you're actually processing data β but the upside is it does not require the
Encode::Mappermodule. Lives inEncode::Arabic::ArabTeX::RE. - ArabTeX-Verbatim β the ArabTeX multi-character verbatim notation for Arabic, mapped against Perl's internal format for the Arabic script. That's
Encode::Arabic::ArabTeX::Verbatim, and yes, it usesEncode::Mapper. - ArabTeX-ZDMG β ArabTeX multi-character notation for Arabic over on one side, Perl's internal format for the Latin phonetic trascription in the ZDMG style on the other. Found in
Encode::Arabic::ArabTeX::ZDMG, usingEncode::Mapper. - ArabTeX-ZDMG-RE β another deprecated one π« β sequential regular-expression substitutions again. Limited in scope over the ArabTeX notation and non-efficient in data processing, but it doesn't need the
Encode::Mappermodule. It'sEncode::Arabic::ArabTeX::ZDMG::RE. - Buckwalter β Buckwalter one-to-one notation for Arabic mapped to Perl's internal format for the Arabic script. That's
Encode::Arabic::Buckwalter. - Parkinson β Parkinson one-to-one notation for Arabic over Perl's internal format for the Arabic script. That's
Encode::Arabic::Parkinson. - Habash β the Habash-Soudi-Buckwalter one-to-one notation for Arabic against Perl's internal format for the Arabic script. That's
Encode::Arabic::Habash.
There are generic aliases to all of these provided by Encode, and here's the tea: case does not matter, and all characters of the class [ _-] are interchangeable. So mix and match your separators, go off. π
Also, quick note: the standardEncodemodule already handles several other single-byte encoding schemes for Arabic that are popular with whichever operating system you're on β*n*x, Windows, DOS or Macintosh. For their identification names and aliases, go look atEncode::SupportedandEncode::Byte.
π EXPORTS & MODES π
The module exports as if use Encode also appeared in the calling package. The import options are just delegated to Encode and the imports get performed properly β with one exception: the :modes option coming first in the list. In that case, the following functions get introduced into the namespace of the importing package:
enmode ($enc, @list)β calls theenmodemethod associated with the given$encencoding, and passes the@listto it. The idea is similar to theencodefunctions and methods of theEncodeandEncode::Encodingmodules respectively. This is your control panel for the modes of conversion.demode ($enc, @list)β the exact analogue ofenmode, except it calls the appropriatedemodemethod instead. See the individual implementations of the listed encodings for the deets.
π SEE ALSO π
- Encode::Arabic Online Interface <http://encode-arabic.sourceforge.net/>
- Encode Arabic Project <http://sourceforge.net/projects/encode-arabic/>
- ElixirFM Online Interface <http://elixir-fm.sourceforge.net/>
- ElixirFM Project <http://sourceforge.net/projects/elixir-fm/>
- Encode, Encode::Encoding, Encode::Mapper, Encode::Byte
- Locale::Recode
- MARC::Charset
- Lingua::AR::MacArabic, Lingua::AR::Word
- Text::TransMetaphone
π«Ά AUTHOR π«Ά
Otakar Smrz "<otakar-smrz users.sf.net>", <http://otakar-smrz.users.sf.net/>
π COPYRIGHT AND LICENSE π
Copyright (C) 2003-2016 Otakar Smrz
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie β¨ this was Encode::Arabic(3pm) from the User Contributed Perl Documentation, written against perl v5.36.0 and dated 2022-10-16 β go forth and encode, you absolute icon ππ
π¦ where this page comes from
- ubuntu noble: libencode-arabic-perl 14.2-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libencode-arabic-perl 14.2-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libencode-arabic-perl 14.2-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms