Small utility to print Unicode symbol names. The main reference is https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt.
$> ucn [FLAGS]
Prints Unicode symbols to Stdout. All processing remains local, no external service is triggered.
-omf.alfred
use special JSON format ready to be used in http://alfredapp.com
-ofmt.etab (default)
use Elastic Tabstops (default)
-ofmt.json
use JSON to print the symbols
-ofmt.tsv
use tab-separated values
-filter.fuzzy value
fuzzy filter all symbol names for <value>
-limit value
limit results to <value> symbols
-filter.partial value
filter all symbol names for a partial match on <value>
-reverse value
reverse list of symbols
-filter.starts-with value
filter all symbol names for the ones which starts-with <value>
-v print version and exit
The filter flags -filter.*
, -limit
and -reverse
can be given multiple
times: they are applied in the order they are provided. See Examples down below.
The output format flags -ofmt.*
can be given multiple times: the last one
given wins.
The -ofmt.*
flags define the output format for the (filtered) Unicode symbols.
Print (filtered) Unicode symbols as properly aligned text by using the Elastic Tabstop algorithm, see http://nickgravgaard.com/elastictabstops/index.html for more information.
The columns are (in order):
- the symbol
- code point number in HEX
- code point in Unicode format (see https://pkg.go.dev/fmt#hdr-Printing)
- HTML entity
- JSON encoded
- the name / description
Print (filtered) Unicode symbols as tab-separated values.
The columns are (in order):
- the symbol
- code point number in HEX
- code point in Unicode format (see https://pkg.go.dev/fmt#hdr-Printing)
- HTML entity
- JSON encoded
- the name / description
Print (filtered) Unicode symbols as JSON.
[
{
"name": "MATHEMATICAL BOLD SMALL PI",
"cp": "U+1D6D1",
"html": "d6d1;",
"json": "\\u1d6d1",
"symbol": "𝛑",
"www": "https://symbl.cc/en/1d6d1"
},
…
]
AlfredApp is using the JSON formatted output to interactively render the results of a search to its UI. See also the #Extras section.
{
"items": [
{
"title": "𝛑 - MATHEMATICAL BOLD SMALL PI",
"subtitle": "U+1D6D1 - d6d1; - https://symbol.cc/en/1d6d1",
"arg": "𝛑",
"variables": {
"cp": "U+1D6D1",
"html": "d6d1;",
"json": "\\u1d6d1",
"symbol": "𝛑",
"www": "https://symbol.cc/en/1d6d1"
}
},
...
Search for the 𝛑 symbol:
$> ucn -filter.partial math -filter.partial "pi" -limit 5
'𝚷' 1d6b7 U+1D6B7 d6b7; \\u1d6b7 MATHEMATICAL BOLD CAPITAL PI
'𝛑' 1d6d1 U+1D6D1 d6d1; \\u1d6d1 MATHEMATICAL BOLD SMALL PI
'𝛡' 1d6e1 U+1D6E1 d6e1; \\u1d6e1 MATHEMATICAL BOLD PI SYMBOL
'𝛱' 1d6f1 U+1D6F1 d6f1; \\u1d6f1 MATHEMATICAL ITALIC CAPITAL PI
'𝜋' 1d70b U+1D70B d70b; \\u1d70b MATHEMATICAL ITALIC SMALL PI
Search for "upward arrows":
$> ucn -filter.starts-with "upwards -filter.starts-with "arrow" -limit 5
'͎' 34e U+034E "e; \\u34e COMBINING UPWARDS ARROW BELOW
'↑' 2191 U+2191 ↑ \\u2191 UPWARDS ARROW
'↟' 219f U+219F ↟ \\u219f UPWARDS TWO HEADED ARROW
'↥' 21a5 U+21A5 ↥ \\u21a5 UPWARDS ARROW FROM BAR
'↰' 21b0 U+21B0 ↰ \\u21b0 UPWARDS ARROW WITH TIP LEFTWARDS
Count the number of embedded Unicode symbols:
$> ucn | wc -l
288767
Limit the available runes to the first 1000, then filter for "pi":
$> ucn -limit 1000 -filter.starts-with pi
'¶' b6 U+00B6 ¶ \\ub6 PILCROW SIGN
'Π' 3a0 U+03A0 Π \\u3a0 GREEK CAPITAL LETTER PI
'π' 3c0 U+03C0 π \\u3c0 GREEK SMALL LETTER PI
'ϖ' 3d6 U+03D6 ϖ \\u3d6 GREEK PI SYMBOL
First filter "pi" in all symbols, then limit the output to 1000 results:
$> ucn -filter.starts-with pi -limit 1000
'¶' b6 U+00B6 ¶ \\ub6 PILCROW SIGN
'Π' 3a0 U+03A0 Π \\u3a0 GREEK CAPITAL LETTER PI
'π' 3c0 U+03C0 π \\u3c0 GREEK SMALL LETTER PI
'ϖ' 3d6 U+03D6 ϖ \\u3d6 GREEK PI SYMBOL
'Փ' 553 U+0553 ȩ \\u553 ARMENIAN CAPITAL LETTER PIWR
'փ' 583 U+0583 ɇ \\u583 ARMENIAN SMALL LETTER PIWR
...
'🧩' 1f9e9 U+1F9E9 f9e9; \\u1f9e9 JIGSAW PUZZLE PIECE
'🧷' 1f9f7 U+1F9F7 f9f7; \\u1f9f7 SAFETY PIN
'🩷' 1fa77 U+1FA77 fa77; \\u1fa77 PINK HEART
'🪅' 1fa85 U+1FA85 fa85; \\u1fa85 PINATA
'🪮' 1faae U+1FAAE faae; \\u1faae HAIR PICK
186 entries in total
Installation:
- Get AlfredApp + Powerpack - https://www.alfredapp.com
- Grab the Alfred-Workflow file (a .zip) from the releases page
- Import it into Alfred.
- Use it - the default triggers are
uc
anducf
(fuzzy)