in reply to Re^4: Somthing related to encoding ??
in thread Somthing related to encoding ??

In your code, how does Encode know the origin encoding? Try:

use strict; use warnings; use Encode; my $string = decode( "iso-8859-6", "أخي الزائر،" ); # see note my $encoded = join '', map { "&#$_;" } unpack 'U*', $string; print "$encoded\n"; __END__ أخٍ افز ائر�

Not sure what happens there in the last character, but the rest is consistent with your desired output. It is likely paste-related at my end, though.

Note: decode converts to utf8, and sets the utf8 flag if there are codepoints above 127. So, split // should then work on the string's characters, rather than bytes. Not sure that any of that works on perl before 5.8.