App-Uni

 view release on metacpan or  search on metacpan

bin/uni  view on Meta::CPAN

#!/usr/bin/perl
use strict;
use warnings;
# PODNAME: uni
# ABSTRACT: command-line utility to find or display Unicode characters

use App::Uni;
use Encode qw(decode);

binmode STDOUT, ':encoding(utf-8)';

@ARGV = map {; decode('UTF-8', $_) } @ARGV;

App::Uni->run(@ARGV);

#pod =head1 DESCRIPTION
#pod
#pod   $ uni ☺
#pod   263A ☺ WHITE SMILING FACE
#pod
#pod   # Only on Perl 5.14+
#pod   $ uni wry
#pod   1F63C <U+1F63C> CAT FACE WITH WRY SMILE
#pod
#pod F<uni> has several modes of operation:
#pod
#pod =head2 DWIM Mode
#pod
#pod By default, F<uni> will interpret your arguments usefully.  If the only
#pod argument is a single character, it will be looked up.  Otherwise, it will work
#pod in name search mode, with the exception that search terms comprised entirely
#pod of hex digits are allowed to match against the codepoint's numeric value.
#pod
#pod =head2 Single Character Mode
#pod
#pod   $ uni -s SINGLE-CHAR
#pod
#pod This will print out the name and codepoint of the character.
#pod
#pod   $ uni -s ¿
#pod   ¿ - U+000BF - INVERTED QUESTION MARK
#pod
#pod =head2 Name Search Mode
#pod
#pod   $ uni -n SOME /SEARCH/ TERMS
#pod
#pod This one will look for codepoints where each term appears as a (\b-bounded)
#pod word in the name. If the term is bounded by slashes, it's treated as a regular
#pod expression and is used to filter candidate codepoints by name.
#pod
#pod   $ uni -n roman five
#pod   â…¤ - U+02164 - ROMAN NUMERAL FIVE
#pod   â…® - U+0216E - ROMAN NUMERAL FIVE HUNDRED
#pod   â…´ - U+02174 - SMALL ROMAN NUMERAL FIVE
#pod   â…¾ - U+0217E - SMALL ROMAN NUMERAL FIVE HUNDRED
#pod   ↁ - U+02181 - ROMAN NUMERAL FIVE THOUSAND
#pod
#pod =head2 String Decomposition
#pod
#pod   $ uni -c SOME STRINGS
#pod
#pod This prints out the codepoints in each string, with a blank line between each
#pod argument's codepoints.
#pod
#pod   $ uni -c Hey リコ
#pod   H - U+00048 - LATIN CAPITAL LETTER H
#pod   e - U+00065 - LATIN SMALL LETTER E
#pod   y - U+00079 - LATIN SMALL LETTER Y
#pod
#pod   リ- U+030EA - KATAKANA LETTER RI



( run in 1.256 second using v1.01-cache-2.11-cpan-f56aa216473 )