diff options
Diffstat (limited to 'utf8ord')
-rwxr-xr-x | utf8ord | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -7,6 +7,14 @@ use charnames qw/:full/; for(@ARGV) { for(split "") { my $c = ord; - printf("%s\t%d\t%04x\t%s\n", $_, $c, $c, charnames::viacode($c)) for split ""; + 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 ""; } } |