in reply to Somthing related to encoding ??

Here's my take on it.

You can use ord but you need to use it on characters not bytes. Unicode can contain multi byte characters and you have to take account of that.

The code below uses HTML::Entities::decode_entities which returns Unicode.

#!/usr/bin/perl use strict; use warnings; use HTML::Entities; my $html_ents = q|أخيالزا&#1 +574;ر،|; my $unicode = decode_entities($html_ents); $unicode =~s/(.)/sprintf("%d ", ord $1)/eg; print "html entities: $html_ents\n"; print "ord on chars: $unicode\n";
Outputs:
html entities: أخي الزا&#157 +4;ر، ord on chars: 1571 1582 1610 32 1575 1604 1586 1575 1574 1585 1548

Hopes this sheds some light on the subject.