#!/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";