Skip to content

Instantly share code, notes, and snippets.

@ksss
Last active December 7, 2015 09:57
Show Gist options
  • Save ksss/ce8224b699bea76223ad to your computer and use it in GitHub Desktop.
Save ksss/ce8224b699bea76223ad to your computer and use it in GitHub Desktop.
$ charnames "a" => "a: LATIN SMALL LETTER A"
#! /usr/bin/env perl
use utf8;
use Encode;
use charnames ':full';
binmode STDIN, ":utf8";
binmode STDOUT, ":utf8";
if (@ARGV == 0) {
print "charnames [char]\n";
exit 0;
}
my $char = Encode::decode_utf8($ARGV[0]);
print substr($char, 0, 1) . ": " . charnames::viacode(ord($char)) . "\n";
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment