#!/usr/bin/perl binmode STDOUT, ":utf8"; use utf8; my @chars = qw/a A 笑 ☺/; for (@chars) { printf "%s: 0x%X\n", $_, ord ($_); }