Last active
December 7, 2015 09:57
-
-
Save ksss/ce8224b699bea76223ad to your computer and use it in GitHub Desktop.
$ charnames "a" => "a: LATIN SMALL LETTER A"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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