Features

Arabic-Indic Digits and some related characters in Unicode are encoded in MacArabic as if normal digits (U+0030..U+0039) when they appear in the left-to-right direction.

Functions

$wchar = decode($octet)

$wchar = decodeMacArabic($octet)

Converts MacArabic to Unicode.

decodeMacArabic() is an alias for decode() exported by default.

$octet = encode($wchar)

$octet = encode($handler, $wchar)

$octet = encodeMacArabic($wchar)

$octet = encodeMacArabic($handler, $wchar)

Converts Unicode to MacArabic.

encodeMacArabic() is an alias for encode() exported by default.

If the $handler is not specified, any character that is not mapped to MacArabic is deleted; if the $handler is a code reference, a string returned from that coderef is inserted there. if the $handler is a scalar reference, a string (a PV) in that reference (the referent) is inserted there.

The 1st argument for the $handler coderef is the Unicode code point (integer) of the unmapped character.