aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutf8ord10
1 files changed, 9 insertions, 1 deletions
diff --git a/utf8ord b/utf8ord
index f413906..de0b6c5 100755
--- a/utf8ord
+++ b/utf8ord
@@ -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 "";
}
}