aboutsummaryrefslogtreecommitdiff
path: root/utf8ord
blob: de0b6c550ffe3278dded1e3ddd5616e1129d38f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl -CIOESA -w

use charnames qw/:full/;

#print ord($_), "\n" for @ARGV;

for(@ARGV) {
	for(split "") {
		my $c = ord;
		my $hex = "";
		my @bytes;
		{
			use bytes;
			@bytes = split //;
			@bytes = map { sprintf("%02x", ord) } @bytes;
			$hex = join(",", @bytes);
		}
		printf("%s\t%d\t%04x\t$hex\t%s\n", $_, $c, $c, charnames::viacode($c)) for split "";
	}
}