in reply to Encoding problem

The Unicode range for Arabic is U+0600 - U+06FF, and the first 128 elements of this range is essentially equivalent to the various non-Unicode Arabic code pages (iso-8859-6 and cp1256, which differ from each other only in what they do with the "non-Arabic" code points -- i.e. the gaps around the actual Arabic letters).

In general, if the Arabic data is in a single-byte encoding (i.e. not in Unicode), then your task is simply to convert from that to Unicode, and all you need to worry about is which non-unicode code page to use: iso-8859-6, or cp1256. The choice will only make a difference if the source data is actually cp1256, and it uses some of the non-ISO code points that M$ is so fond of (e.g. "smart quotes", "special hyphen", possibly even some accented Latin letters like é): those will show up as "\x{fffd}" when you treat the input as iso-8859-6 when converting to unicode.

So the best strategy is: assume the data is really cp1256 (because this will cause no harm to iso-8859-6 data) -- a simple one-liner will do:

perl -e 'open(I,q/<:encoding(cp1256)/,shift);binmode STDOUT,q/:utf8/;p +rint <I>' ifile > ofile
(It's very unlikely that the source data involves the old and all-too-clever MacArabic encoding, but if it did, there is a module for handling that as well: Lingua::AR::MacArabic. This encoding stands out in having two versions of various bracketing characters, left-to-right vs right-to-left. Don't worry about it.)

(updated to shorten the one-liner a bit (then a bit more), and to put a real accented letter in the second paragraph)