From 03ebbfe2ec5252a55301e9aea4a406e9bc6da60c Mon Sep 17 00:00:00 2001 From: hjp Date: Mon, 2 Apr 2012 15:00:46 +0000 Subject: [PATCH] Added perl version (uses Unicode). --- chartab/chartab.pl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 chartab/chartab.pl diff --git a/chartab/chartab.pl b/chartab/chartab.pl new file mode 100755 index 0000000..05a3070 --- /dev/null +++ b/chartab/chartab.pl @@ -0,0 +1,28 @@ +#!/usr/bin/perl +use warnings; +use strict; +use charnames (); + +use Getopt::Long; +use Pod::Usage; + +my $all; + +GetOptions( + 'all' => \$all +) or pod2usage(2); + +binmode STDOUT, ":encoding(UTF-8)"; +for my $c (0 .. 0xFFFF) { + my $cc = pack('U', $c); + if (charnames::viacode($c) || $all) { + printf("%04x %5d %06o %s %s\n", + $c, + $c, + $c, + (($cc =~ /[[:print:]]/) ? $cc : '.'), + charnames::viacode($c) || '' + ); + } +} +print "\n";