#!/usr/bin/perl use strict; use warnings; use HTML::Entities; my $html_ents = q|أخيالزائر،|; 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"; #### html entities: أخي الزائر، ord on chars: 1571 1582 1610 32 1575 1604 1586 1575 1574 1585 1548