• Stars
    star
    776
  • Rank 58,565 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 6 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Query the Unicode database from the commandline, with good support for emojis

uni queries the Unicode database from the commandline. It supports Unicode 14.0 (September 2021) and has good support for emojis.

There are four commands: identify codepoints in a string, search for codepoints, print codepoints by class, block, or range, and emoji to find emojis.

There are binaries on the releases page, and packages for a number of platforms. You can also run it in your browser.

Compile from source with:

$ git clone https://github.com/arp242/uni
$ cd uni
$ go build

which will give you a uni binary.

README index:

Integrations

  • dmenu, rofi, and fzf script at dmenu-uni. See the top of the script for some options you may want to frob with.

  • For a Vim command see uni.vim; just copy/paste it in your vimrc.

Usage

Note: the alignment is slightly off for some entries due to the way GitHub renders wide characters; in terminals it should be aligned correctly.

Identify

Identify characters in a string, as a kind of a unicode-aware hexdump:

$ uni identify โ‚ฌ
     CPoint  Dec    UTF8        HTML       Name (Cat)
'โ‚ฌ'  U+20AC  8364   e2 82 ac    €     EURO SIGN (Currency_Symbol)

i is a shortcut for identify:

$ uni i hโ‚ฌรฝ
     CPoint  Dec    UTF8        HTML       Name (Cat)
'h'  U+0068  104    68          h     LATIN SMALL LETTER H (Lowercase_Letter)
'โ‚ฌ'  U+20AC  8364   e2 82 ac    €     EURO SIGN (Currency_Symbol)
'รฝ'  U+00FD  253    c3 bd       ý   LATIN SMALL LETTER Y WITH ACUTE (Lowercase_Letter)

It reads from stdin:

$ head -c2 README.markdown | uni i
     cpoint  dec    utf-8       html       name (cat)
'['  U+005B  91     5b          [     LEFT SQUARE BRACKET (Open_Punctuation)
'!'  U+0021  33     21          !     EXCLAMATION MARK (Other_Punctuation)

You can use -compact (or -c) to suppress the header, and -format (or -f) to control the output format, for example you may want to generate a codepoint to X11 keysym mapping:

$ uni i -c -f '0x%(hex): "%(keysym)", // %(name)' hโ‚ฌรฝ
0x68: "h", // LATIN SMALL LETTER H
0x20ac: "EuroSign", // EURO SIGN
0xfd: "yacute", // LATIN SMALL LETTER Y WITH ACUTE

See uni help for more details on the -format flag; this flag can also be added to other commands.

Search

Search description:

$ uni search euro
     CPoint  Dec    UTF8        HTML       Name (Cat)
'โ‚ '  U+20A0  8352   e2 82 a0    ₠   EURO-CURRENCY SIGN (Currency_Symbol)
'โ‚ฌ'  U+20AC  8364   e2 82 ac    €     EURO SIGN (Currency_Symbol)
'๐กท'  U+10877 67703  f0 90 a1 b7 𐡷  PALMYRENE LEFT-POINTING FLEURON (Other_Symbol)
'๐กธ'  U+10878 67704  f0 90 a1 b8 𐡸  PALMYRENE RIGHT-POINTING FLEURON (Other_Symbol)
'๐ซฑ'  U+10AF1 68337  f0 90 ab b1 𐫱  MANICHAEAN PUNCTUATION FLEURON (Other_Punctuation)
'๐ŸŒ' U+1F30D 127757 f0 9f 8c 8d 🌍  EARTH GLOBE EUROPE-AFRICA (Other_Symbol)
'๐Ÿค' U+1F3E4 127972 f0 9f 8f a4 🏤  EUROPEAN POST OFFICE (Other_Symbol)
'๐Ÿฐ' U+1F3F0 127984 f0 9f 8f b0 🏰  EUROPEAN CASTLE (Other_Symbol)
'๐Ÿ’ถ' U+1F4B6 128182 f0 9f 92 b6 💶  BANKNOTE WITH EURO SIGN (Other_Symbol)

The s command is a shortcut for search. Multiple words are matched individually:

$ uni s globe earth
     CPoint  Dec    UTF8        HTML       Name (Cat)
'๐ŸŒ' U+1F30D 127757 f0 9f 8c 8d 🌍  EARTH GLOBE EUROPE-AFRICA (Other_Symbol)
'๐ŸŒŽ' U+1F30E 127758 f0 9f 8c 8e 🌎  EARTH GLOBE AMERICAS (Other_Symbol)
'๐ŸŒ' U+1F30F 127759 f0 9f 8c 8f 🌏  EARTH GLOBE ASIA-AUSTRALIA (Other_Symbol)

Use shell quoting for more literal matches:

$ uni s rightwards black arrow
     CPoint  Dec    UTF8        HTML       Name (Cat)
'โžก'  U+27A1  10145  e2 9e a1    ➡   BLACK RIGHTWARDS ARROW (Other_Symbol)
'โžค'  U+27A4  10148  e2 9e a4    ➤   BLACK RIGHTWARDS ARROWHEAD (Other_Symbol)
โ€ฆ

$ uni s 'rightwards black arrow'
     CPoint  Dec    UTF8        HTML       Name (Cat)
'โฎ•'  U+2B95  11157  e2 ae 95    ⮕   RIGHTWARDS BLACK ARROW (Other_Symbol)

Add -or or -o to combine the search terms with "OR" instead of "AND":

$ uni s -o globe milky
     CPoint  Dec    UTF8        HTML       Name (Cat)
'๐ŸŒŒ' U+1F30C 127756 f0 9f 8c 8c 🌌  MILKY WAY (Other_Symbol)
'๐ŸŒ' U+1F30D 127757 f0 9f 8c 8d 🌍  EARTH GLOBE EUROPE-AFRICA (Other_Symbol)
'๐ŸŒŽ' U+1F30E 127758 f0 9f 8c 8e 🌎  EARTH GLOBE AMERICAS (Other_Symbol)
'๐ŸŒ' U+1F30F 127759 f0 9f 8c 8f 🌏  EARTH GLOBE ASIA-AUSTRALIA (Other_Symbol)
'๐ŸŒ' U+1F310 127760 f0 9f 8c 90 🌐  GLOBE WITH MERIDIANS (Other_Symbol)

Print

Print specific codepoints or groups of codepoints:

$ uni print U+2042
     CPoint  Dec    UTF8        HTML       Name (Cat)
'โ‚'  U+2042  8258   e2 81 82    ⁂   ASTERISM (Other_Punctuation)

Print a custom range; U+2042, U2042, and 2042 are all identical:

$ uni print 2042..2044
     CPoint  Dec    UTF8        HTML       Name (Cat)
'โ‚'  U+2042  8258   e2 81 82    ⁂   ASTERISM (Other_Punctuation)
'โƒ'  U+2043  8259   e2 81 83    ⁃   HYPHEN BULLET (Other_Punctuation)
'โ„'  U+2044  8260   e2 81 84    ⁄    FRACTION SLASH (Math_Symbol)

You can also use hex, octal, and binary numbers: 0x2024, 0o20102, or 0b10000001000010.

General category:

$ uni p Po
Showing category Po (Other_Punctuation)
     CPoint  Dec    UTF8        HTML       Name (Cat)
'!'  U+0021  33     21          !     EXCLAMATION MARK (Other_Punctuation)
โ€ฆ

Blocks:

$ uni p arrows 'box drawing'
Showing block Arrows
Showing block Box Drawing
     CPoint  Dec    UTF8        HTML       Name (Cat)
'โ†'  U+2190  8592   e2 86 90    ←     LEFTWARDS ARROW (Math_Symbol)
'โ†‘'  U+2191  8593   e2 86 91    ↑     UPWARDS ARROW (Math_Symbol)
โ€ฆ

Print as table, and with a shorter name:

$ uni p -as table box
Showing block Box Drawing
         0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
U+250x โ”‚ โ”€   โ”   โ”‚   โ”ƒ   โ”„   โ”…   โ”†   โ”‡   โ”ˆ   โ”‰   โ”Š   โ”‹   โ”Œ   โ”   โ”Ž   โ”  
       โ”‚
U+251x โ”‚ โ”   โ”‘   โ”’   โ”“   โ””   โ”•   โ”–   โ”—   โ”˜   โ”™   โ”š   โ”›   โ”œ   โ”   โ”ž   โ”Ÿ  
       โ”‚
U+252x โ”‚ โ”    โ”ก   โ”ข   โ”ฃ   โ”ค   โ”ฅ   โ”ฆ   โ”ง   โ”จ   โ”ฉ   โ”ช   โ”ซ   โ”ฌ   โ”ญ   โ”ฎ   โ”ฏ  
       โ”‚
U+253x โ”‚ โ”ฐ   โ”ฑ   โ”ฒ   โ”ณ   โ”ด   โ”ต   โ”ถ   โ”ท   โ”ธ   โ”น   โ”บ   โ”ป   โ”ผ   โ”ฝ   โ”พ   โ”ฟ  
       โ”‚
U+254x โ”‚ โ•€   โ•   โ•‚   โ•ƒ   โ•„   โ•…   โ•†   โ•‡   โ•ˆ   โ•‰   โ•Š   โ•‹   โ•Œ   โ•   โ•Ž   โ•  
       โ”‚
U+255x โ”‚ โ•   โ•‘   โ•’   โ•“   โ•”   โ••   โ•–   โ•—   โ•˜   โ•™   โ•š   โ•›   โ•œ   โ•   โ•ž   โ•Ÿ  
       โ”‚
U+256x โ”‚ โ•    โ•ก   โ•ข   โ•ฃ   โ•ค   โ•ฅ   โ•ฆ   โ•ง   โ•จ   โ•ฉ   โ•ช   โ•ซ   โ•ฌ   โ•ญ   โ•ฎ   โ•ฏ  
       โ”‚
U+257x โ”‚ โ•ฐ   โ•ฑ   โ•ฒ   โ•ณ   โ•ด   โ•ต   โ•ถ   โ•ท   โ•ธ   โ•น   โ•บ   โ•ป   โ•ผ   โ•ฝ   โ•พ   โ•ฟ  
       โ”‚

Or more compact table:

$ uni p -as table box -compact
         0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
U+250x โ”‚ โ”€   โ”   โ”‚   โ”ƒ   โ”„   โ”…   โ”†   โ”‡   โ”ˆ   โ”‰   โ”Š   โ”‹   โ”Œ   โ”   โ”Ž   โ”  
U+251x โ”‚ โ”   โ”‘   โ”’   โ”“   โ””   โ”•   โ”–   โ”—   โ”˜   โ”™   โ”š   โ”›   โ”œ   โ”   โ”ž   โ”Ÿ  
U+252x โ”‚ โ”    โ”ก   โ”ข   โ”ฃ   โ”ค   โ”ฅ   โ”ฆ   โ”ง   โ”จ   โ”ฉ   โ”ช   โ”ซ   โ”ฌ   โ”ญ   โ”ฎ   โ”ฏ  
U+253x โ”‚ โ”ฐ   โ”ฑ   โ”ฒ   โ”ณ   โ”ด   โ”ต   โ”ถ   โ”ท   โ”ธ   โ”น   โ”บ   โ”ป   โ”ผ   โ”ฝ   โ”พ   โ”ฟ  
U+254x โ”‚ โ•€   โ•   โ•‚   โ•ƒ   โ•„   โ•…   โ•†   โ•‡   โ•ˆ   โ•‰   โ•Š   โ•‹   โ•Œ   โ•   โ•Ž   โ•  
U+255x โ”‚ โ•   โ•‘   โ•’   โ•“   โ•”   โ••   โ•–   โ•—   โ•˜   โ•™   โ•š   โ•›   โ•œ   โ•   โ•ž   โ•Ÿ  
U+256x โ”‚ โ•    โ•ก   โ•ข   โ•ฃ   โ•ค   โ•ฅ   โ•ฆ   โ•ง   โ•จ   โ•ฉ   โ•ช   โ•ซ   โ•ฌ   โ•ญ   โ•ฎ   โ•ฏ  
U+257x โ”‚ โ•ฐ   โ•ฑ   โ•ฒ   โ•ณ   โ•ด   โ•ต   โ•ถ   โ•ท   โ•ธ   โ•น   โ•บ   โ•ป   โ•ผ   โ•ฝ   โ•พ   โ•ฟ  

Emoji

The emoji command (shortcut: e) is is the real reason I wrote this:

$ uni e cry
	Name                     (Cldr)
๐Ÿฅน	face holding back tears  (angry, cry, proud, resist, sad)
๐Ÿ˜ข	crying face              (sad, tear)
๐Ÿ˜ญ	loudly crying face       (sad, sob, tear)
๐Ÿ˜ฟ	crying cat               (face, sad, tear)
๐Ÿ”ฎ	crystal ball             (fairy tale, fantasy, fortune, tool)

By default both the name and CLDR data are searched; the CLDR data is a list of keywords for an emoji; prefix with name: or n: to search on the name only:

$ uni e smile
	Name                             (Cldr)
๐Ÿ˜ƒ	grinning face with big eyes      (mouth, open, smile)
๐Ÿ˜„	grinning face with smiling eyes  (mouth, open, smile)
โ€ฆ

$ uni e name:smile
	Name                (Cldr)
๐Ÿ˜ผ	cat with wry smile  (face, ironic)

As you can see, the CLDR is pretty useful, as "smile" only gives one result as most emojis use "smiling".

Prefix with group: to search by group:

$ uni e group:hands
	Name               (Cldr)
๐Ÿ‘	clapping hands     ()
๐Ÿ™Œ	raising hands      (celebration, gesture, hooray, raised)
๐Ÿซถ	heart hands        (love)
๐Ÿ‘	open hands         ()
๐Ÿคฒ	palms up together  (prayer)
๐Ÿค	handshake          (agreement, meeting)
๐Ÿ™	folded hands       (ask, high 5, high five, please, pray, thanks)

Group and search can be combined, and group: can be abbreviated to g::

$ uni e g:cat-face grin
	Name                            (Cldr)
๐Ÿ˜บ	grinning cat                    (face, mouth, open, smile)
๐Ÿ˜ธ	grinning cat with smiling eyes  (face, smile)

Like with search, use -or to OR the parameters together instead of AND:

$ uni e -or g:face-glasses g:face-hat
	Name                          (Cldr)
๐Ÿค 	cowboy hat face               (cowgirl)
๐Ÿฅณ	partying face                 (celebration, hat, horn)
๐Ÿฅธ	disguised face                (glasses, incognito, nose)
๐Ÿ˜Ž	smiling face with sunglasses  (bright, cool)
๐Ÿค“	nerd face                     (geek)
๐Ÿง	face with monocle             (stuffy)

Apply skin tone modifiers with -tone:

$ uni e -tone dark g:hands
	Name                               (Cldr)
๐Ÿ‘๐Ÿฟ	clapping hands: dark skin tone     ()
๐Ÿ™Œ๐Ÿฟ	raising hands: dark skin tone      (celebration, gesture, hooray, raised)
๐Ÿซถ๐Ÿฟ	heart hands: dark skin tone        (love)
๐Ÿ‘๐Ÿฟ	open hands: dark skin tone         ()
๐Ÿคฒ๐Ÿฟ	palms up together: dark skin tone  (prayer)
๐Ÿค	handshake                          (agreement, meeting)
๐Ÿ™๐Ÿฟ	folded hands: dark skin tone       (ask, high 5, high five, please, pray, thanks)

The "heart hands" may not show as it's very recent. The handshake emoji supports setting individual skin tones per hand since Unicode 14, but this isn't supported, mostly because I can't really really think a good CLI interface for setting this without breaking compatibility (there are some other emojis too, like "holding hands" and "kissing" where you can set both the gender and skin tone of both sides individually). Maybe for uni v3 someday.

The default is to display only the gender-neutral "person", but this can be changed with the -gender option:

$ uni e -gender man g:person-gesture
	Name              (Cldr)
๐Ÿ™โ€โ™‚๏ธ	man frowning      (gesture, person frowning)
๐Ÿ™Žโ€โ™‚๏ธ	man pouting       (gesture, person pouting)
๐Ÿ™…โ€โ™‚๏ธ	man gesturing NO  (forbidden, gesture, hand, person gesturing NO, prohibited)
๐Ÿ™†โ€โ™‚๏ธ	man gesturing OK  (gesture, hand, person gesturing OK)
๐Ÿ’โ€โ™‚๏ธ	man tipping hand  (help, information, person tipping hand, sassy)
๐Ÿ™‹โ€โ™‚๏ธ	man raising hand  (gesture, happy, person raising hand, raised)
๐Ÿงโ€โ™‚๏ธ	deaf man          (accessibility, deaf person, ear, hear)
๐Ÿ™‡โ€โ™‚๏ธ	man bowing        (apology, gesture, person bowing, sorry)
๐Ÿคฆโ€โ™‚๏ธ	man facepalming   (disbelief, exasperation, person facepalming)
๐Ÿคทโ€โ™‚๏ธ	man shrugging     (doubt, ignorance, indifference, person shrugging)

Both -tone and -gender accept multiple values. -gender women,man will display both the female and male variants, and -tone light,dark will display both a light and dark skin tone; use all to display all skin tones or genders:

$ uni e -tone light,dark -gender f,m shrug
	Name                              (Cldr)
๐Ÿคท๐Ÿปโ€โ™‚๏ธ	man shrugging: light skin tone    (doubt, ignorance, indifference, person shrugging)
๐Ÿคท๐Ÿปโ€โ™€๏ธ	woman shrugging: light skin tone  (doubt, ignorance, indifference, person shrugging)
๐Ÿคท๐Ÿฟโ€โ™‚๏ธ	man shrugging: dark skin tone     (doubt, ignorance, indifference, person shrugging)
๐Ÿคท๐Ÿฟโ€โ™€๏ธ	woman shrugging: dark skin tone   (doubt, ignorance, indifference, person shrugging)

Like print and identify, you can use -format:

$ uni e g:cat-face -c -format '%(name): %(emoji)'
grinning cat: ๐Ÿ˜บ
grinning cat with smiling eyes: ๐Ÿ˜ธ
cat with tears of joy: ๐Ÿ˜น
smiling cat with heart-eyes: ๐Ÿ˜ป
cat with wry smile: ๐Ÿ˜ผ
kissing cat: ๐Ÿ˜ฝ
weary cat: ๐Ÿ™€
crying cat: ๐Ÿ˜ฟ
pouting cat: ๐Ÿ˜พ

See uni help for more details on the -format flag.

JSON

With -as json or -as j you can output the data as JSON:

$ uni i -as json hโ‚ฌรฝ
[{
	"cat": "Lowercase_Letter",
	"char": "h",
	"cpoint": "U+0068",
	"dec": "104",
	"html": "h",
	"name": "LATIN SMALL LETTER H",
	"utf8": "68"
}, {
	"cat": "Currency_Symbol",
	"char": "โ‚ฌ",
	"cpoint": "U+20AC",
	"dec": "8364",
	"html": "€",
	"name": "EURO SIGN",
	"utf8": "e2 82 ac"
}, {
	"cat": "Lowercase_Letter",
	"char": "รฝ",
	"cpoint": "U+00FD",
	"dec": "253",
	"html": "ý",
	"name": "LATIN SMALL LETTER Y WITH ACUTE",
	"utf8": "c3 bd"
}]

All the columns listed in -f will be included; you can use -f all to include all columns:

$ uni i -as json -f all hโ‚ฌรฝ
[{
	"bin": "1101000",
	"block": "Basic Latin",
	"cat": "Lowercase_Letter",
	"char": "h",
	"cpoint": "U+0068",
	"dec": "104",
	"digraph": "h",
	"hex": "68",
	"html": "h",
	"json": "\\u0068",
	"keysym": "h",
	"name": "LATIN SMALL LETTER H",
	"oct": "150",
	"plane": "Basic Multilingual Plane",
	"props": "",
	"script": "Latin",
	"utf16be": "00 68",
	"utf16le": "68 00",
	"utf8": "68",
	"width": "neutral",
	"xml": "h"
}, {
	"bin": "10000010101100",
	"block": "Currency Symbols",
	"cat": "Currency_Symbol",
	"char": "โ‚ฌ",
	"cpoint": "U+20AC",
	"dec": "8364",
	"digraph": "=e",
	"hex": "20ac",
	"html": "€",
	"json": "\\u20ac",
	"keysym": "EuroSign",
	"name": "EURO SIGN",
	"oct": "20254",
	"plane": "Basic Multilingual Plane",
	"props": "",
	"script": "Common",
	"utf16be": "20 ac",
	"utf16le": "ac 20",
	"utf8": "e2 82 ac",
	"width": "ambiguous",
	"xml": "€"
}, {
	"bin": "11111101",
	"block": "Latin-1 Supplement",
	"cat": "Lowercase_Letter",
	"char": "รฝ",
	"cpoint": "U+00FD",
	"dec": "253",
	"digraph": "y'",
	"hex": "fd",
	"html": "ý",
	"json": "\\u00fd",
	"keysym": "yacute",
	"name": "LATIN SMALL LETTER Y WITH ACUTE",
	"oct": "375",
	"plane": "Basic Multilingual Plane",
	"props": "",
	"script": "Latin",
	"utf16be": "00 fd",
	"utf16le": "fd 00",
	"utf8": "c3 bd",
	"width": "narrow",
	"xml": "ý"
}]

This also works for the emoji command:

$ uni e -as json -f all 'kissing cat'
[{
	"cldr": "eye, face",
	"cldr_full": "cat, eye, face, kiss, kissing cat",
	"cpoint": "U+1F63D",
	"emoji": "๐Ÿ˜ฝ",
	"group": "Smileys & Emotion",
	"name": "kissing cat",
	"subgroup": "cat-face"
}]

All values are always a string, even numerical values. This makes things a bit easier/consistent as JSON doesn't support hex literals and such. Use jq or some other tool if you want to process the data further.

ChangeLog

unreleased

  • Add "script" property (e.g. uni i a -f '%(script)'). Also supported in the list and print commands (uni list scripts, uni p 'script:linear a'.

2.5.1 (2022-05-09)

  • Fix build on Go 1.17 and earlier.

2.5.0 (2022-05-03)

  • Add support for properties; they can be displayed with %(props) in -format, and selected in print (e.g. uni print dash).

  • Add uni list command, to list categories, blocks, and properties.

  • Allow explicitly selecting a block, category, or property in print with block:name (b:name), category:name (cat:name, c:name), or property:name (prop:name, p:name).

    Also print an error if a string without prefix matched more than one group (i.e. uni p dash matches both the property Dash and category Dash_Punctuation).

  • Add table layout with -as table. Also change -json/-j to -as json or -as j. The -json flag is still accepted as an alias for compatibility.

  • Change -q/-quiet to -c/-compact; -as json will print as minified if given, and -as table will include less padding. -q is still accepted as an alias for compatibility.

  • Don't use the Go stdlib unicode package; since this is a Unicode 13 database and some operations would fail on codepoints added in Unicode 14 due to the mismatch.

v2.4.0 (2021-12-20)

  • Update import path to zgo.at/uni/v2.

  • Add oct and bin flags for -f to print a codepoint as octal or binary.

  • Add f format flag to change the fill character with alignment; e.g. %(bin r:auto f:0) will print zeros on the left.

  • Allow using just o123 for an octal number (instead of 0o123). We can't do this for binary and decimal numbers (since b and d are valid hexidecimals), but no reason not to do it for o.

v2.3.0 (2021-10-05)

  • Update to Unicode 14.0.

  • UTF-16 and JSON are printed as lower case, just like UTF-8 was. Upper-case is used only for codepoints (i.e. U+00AC).

  • uni print can now print from UTF-8 byte sequence; for example to print the โ‚ฌ sign:

    uni p utf8:e282ac
    uni p 'utf8:e2 82 ac'
    uni p 'utf8:0xe2 0x82 0xac'
    

    Bytes can optionally be separated by any combination of 0x, -, _, or spaces.

v2.2.1 (2021-06-15)

  • You can now use uni p 0d40 to get U+28 by decimal.

    uni print 40 interprets the 40 as hex instead of decimal, and there was no way to get a codepoint by decimal number. Since codepoints are much more more common than decimals, leaving off the U+ and U is a useful shortcut I'd like to keep. AFAIK there isn't really a standard(-ish) was to explicitly indicate a number is a decimal, so this is probably the closest.

v2.2.0 (2021-06-05)

  • Make proper use of the /v2 import path so that go get and go install work. (#26)

  • Don't panic if -f doesn't contain any formatting characters.

v2.1.0 (2021-03-30)

  • Can now output as JSON with -j or -json.

  • -format all is a special value to include all columns uni knows about. This is useful especially in combination with -json.

  • Add %(block), %(plane), %(width), %(utf16be), %(utf16le), and %(json) to -f`.

  • Refactor the arp242.net/uni/unidata package to be more useful for other use cases. This isn't really relevant for uni users as such, but if you want to get information about codepoints or emojis then this package is a nice addition to the standard library's unicode package.

v2.0.0 (2021-01-03)

This changes some flags, semantics, and defaults in incompatible ways, hence the bump to 2.0. If you use the dmenu-uni script with dmenu or fzf, then you'll need to update that to.

  • Remove the -group flag in favour of group:name syntax; this is more flexible and will allow adding more query syntax later.

    uni emoji -group groupname,othergroup                  Old syntax
    uni emoji -group groupname,othergroup smile            Old syntax
    
    uni emoji -or group:groupname group:othergroup         New syntax
    uni emoji -or group:groupname group:othergroup smile   New syntax
    
    uni emoji -or g:groupname g:othergroup                 Can use shorter g: instead of group:
    
  • Default for -gender is now person instead of all; including all genders by default isn't all that useful, and the gender-neutral "person" should be a fine default for most, just as the skin colour-neutral "yellow" is probably a fine default for most.

  • Add new -or/-o flag. The default for search and emoji is to show everything where all query parameters match ("AND"); with this flag it shows everything where at least one parameter matches ("OR").

  • Add new -format/-f flag to control which columns to output and column width. You can now also print X11 keysyms and Vim digraphs. See uni help for details.

  • Include CLDR data for emojis, which is searched by default if you use uni e <something>. You can use uni e name:x to search for the name specifically.

  • Show a short terse help when using just uni, and a more detailed help on uni help. I hate it when programs print 5 pages of text to my terminal when I didn't ask for it.

  • Update Unicode data to 13.1.

  • Add option to output to $PAGER with -p or -pager. This isn't done automatically (I don't really like it when programs throw me in a pager), but you can define a shell alias (alias uni='uni -p') if you want it by default since flags can be both before or after the command.

v1.1.1 (2020-05-31)

  • Fix tests of v1.1.0, requested by a packager. No changes other than this.

v1.1.0 (2020-03-17)

  • Update Unicode data from 12.1 to 13.0.

  • print command supports codepoints as hex (0xff), octal (0o42), and binary (0b1001).

  • A few very small bugfixes.

v1.0.0 (2019-12-12)

  • Initial release

Development

Re-generate the Unicode data with go generate unidata. Files are cached in unidata/.cache, so clear that if you want to update the files from remote. This requires zsh and GNU awk (gawk).

Alternatives

CLI/TUI

  • https://github.com/philpennock/character

    More or less similar to uni, but very different CLI, and has some additional features. Seems pretty good.

  • https://github.com/sindresorhus/emoj

    Doesn't support emojis sequences (e.g. MAN SHRUGGING is PERSON SHRUGGING + MAN, FIREFIGHTER is PERSON + FIRE TRUCK, etc); quite slow for a CLI program (emoj smiling takes 1.8s on my system, sometimes a lot longer), search results are pretty bad (shrug returns unamused face, thinking face, eyes, confused face, neutral face, tears of joy, and expressionless face ... but not the shrugging emoji), not a fan of npm (has 1862 dependencies).

  • https://github.com/Fingel/tuimoji

    Grouping could be better, doesn't support emojis sequences, only interactive TUI, feels kinda slow-ish especially when searching.

  • https://github.com/pemistahl/chr

    Only deals with codepoints, not emojis.

GUI

  • gnome-characters

    Uses Gnome interface/window decorations and won't work well with other WMs, doesn't deal with emoji sequences, I don't like the grouping/ordering it uses, requires two clicks to copy a character.

  • gucharmap

    Doesn't display emojis, just unicode blocks.

  • KCharSelect

    Many KDE-specific dependencies (106M). Didn't try it.

  • https://github.com/Mange/rofi-emoji and https://github.com/fdw/rofimoji

    Both are pretty similar to the dmenu/rofi integration of uni with some minor differences, and both seem to work well with no major issues.

  • gtk3 emoji picker (Ctrl+; or Ctrl+. in gtk 3.93 or newer)

    Only works in GTK, doesn't work with GTK_IM_MODULE=xim (needed for compose key), for some reasons the emojis look ugly, doesn't display emojis sequences, doesn't have a tooltip or other text description about what the emoji actually is, the variation selector doesn't seem to work (never displays skin tone?), doesn't work in Firefox.

    This is so broken on my system that it seems that I'm missing something for this to work or something?

  • https://github.com/rugk/awesome-emoji-picker

    Only works in Firefox; takes a tad too long to open; doesn't support skin tones.

Didn't investigate (yet)

Some alternatives people have suggested that I haven't looked at; make an issue or email me if you know of any others.

More Repositories

1

goatcounter

Easy web analytics. No tracking of personal data.
Go
4,235
star
2

hello-css

A CSS template focused on readability
CSS
178
star
3

find-cursor

Highlight the cursor position in X11
C
167
star
4

gopher.vim

Plugin for the Go programming language
Vim Script
116
star
5

zcache

In-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications
Go
61
star
6

dotfiles

My configuration files
Shell
60
star
7

zli

Go library for writing CLI programs. Includes flag parsing, colours, testing, and various helpful utility functions
Go
39
star
8

jumpy.vim

Filetype-specific mappings for [[, ]], g[, and g]
Vim Script
38
star
9

arp242.net

This is my site. There are many like it, but this one is mine.
HTML
34
star
10

gogo-release

Build cross-platform binaries for Go
Shell
32
star
11

singlepage

Bundle external assets in a HTML file to distribute a stand-alone HTML document.
Go
26
star
12

toml-c

TOML C library
C
26
star
13

info

A simple GNU info replacement which isn't terrible
Go
24
star
14

bestasciitable

The bestโ„ข ASCII table
HTML
20
star
15

isbot

Go library to detect HTTP bots.
Go
19
star
16

follow

Go library to follow a file for changes; e.g. "tail -F".
Go
19
star
17

download-npo

Download episodes from the Dutch npostart.nl โˆ’ Download afleveringen van npostart.nl
Python
18
star
18

undofile_warn.vim

Warn when using the undofile
Vim Script
18
star
19

sconfig

Simple and functional configuration file parser for Go.
Go
17
star
20

vimlog

A ChangeLog for Vim
HTML
16
star
21

packman.vim

Simple Vim plugin/package manager
Shell
14
star
22

runbuf.vim

Run the contents of a buffer in psql, python, bash, etc.
Vim Script
13
star
23

startscreen.vim

Customize Vim's start screen.
Vim Script
12
star
24

testing.vim

Comprehensive testing tool for Vim
Shell
12
star
25

ttftrim

Remove glyps from TTF fonts
Python
11
star
26

zdb

Interact with SQL databases in Go
Go
11
star
27

readon.js

Continue reading a web page from where you left last time
JavaScript
11
star
28

xdg_open.vim

Run xdg-open from Vim; re-implements netrw's gx.
Vim Script
11
star
29

auto_mkdir2.vim

Automatically create directories
Vim Script
10
star
30

zhttp

Martin's HTTP package
Go
10
star
31

MartinFox

Really simple userChrome.css for Firefox 89 to make the active tab stand out more
CSS
10
star
32

switchy.vim

Switch to related files
Vim Script
9
star
33

gadget

Go library to get the browser and OS from the User-Agent header.
Go
9
star
34

zprof

Display runtime profiling data for Go programs over HTTP
Go
9
star
35

my-first-vimrc

A vimrc generator that doesn't add a world of complexity
HTML
9
star
36

ff-hist

Search Firefox history from commandline
Shell
9
star
37

zsrv

Static file server which packs all data in the binary
Go
9
star
38

pkg_clearleaves

Easily remove packages on which no other packages depend
Python
8
star
39

blackmail

Go package to send emails with a friendly API
Go
8
star
40

lpeg.vim

LPeg-based syntax highlighting in Vim
Lua
8
star
41

colorcount

Display the colours used in a PNG image
Go
7
star
42

goatcounter-wordpress

WordPress plugin for GoatCounter
PHP
7
star
43

transip-dynamic

Dynamic DNS for TransIP
Go
6
star
44

imgzoom.js

JavaScript image zoomer
HTML
6
star
45

goimport

Add, remove, or replace imports in Go files
Go
6
star
46

sanitize_files

Basic cleanup of your code
Python
6
star
47

battray

Display tray icon with battery status; can also run scripts when the status changes
Python
5
star
48

helplink.vim

Link to Vim help pages with ease.
Vim Script
5
star
49

zev.vim

Easily apply predefined substitute patterns
Vim Script
5
star
50

zstd

Extensions to Go's stdlib
Go
5
star
51

gomodgraph

'go mod graph' as a nicely indented graph
Go
5
star
52

trackwall

DNS proxy and filter โˆ’ /etc/hosts on steroids.
Go
4
star
53

rogue-clone

The "rogue" game from 4.3BSD-Tahoe, for modern systems.
C
4
star
54

goon

Run Go on another machine such as a QEMU VM or cloud instance
Shell
4
star
55

lazy.vim

The really simple snippet manager
Vim Script
4
star
56

border

Commandline tool to add a border around PNG images
Go
4
star
57

batchy.vim

A little plugin to perform batch operations on files
Vim Script
4
star
58

cantuse

List browsers in which a feature *won't* work
Go
3
star
59

confirm_quit.vim

Ask for confirmation before quitting Vim.
Vim Script
3
star
60

goatcov

Code coverage tool for Go
Go
3
star
61

bsdgrep

BSD grep from FreeBSD for Linux
C
3
star
62

zvalidate

Static validation for Go that returns parsed values
Go
3
star
63

autofox

Automatically configure Firefox
Go
3
star
64

tz

Go timezone convience library
Go
3
star
65

errors

Yet another errors package for Go
Go
3
star
66

wtff

frontend for some ffmpeg operations
Go
3
star
67

sqlbench

Run benchmarks on an SQL database
Go
3
star
68

zlog

Go logging library
Go
3
star
69

acidtab

Go package to print nicely aligned tables in the terminal
Go
3
star
70

git-stats

Aggregate statistics for git repos
Go
3
star
71

slog_align

Less "wall of text"-y slog handler
Go
3
star
72

aurgit

A simple way to manage AUR packages
Python
2
star
73

hubhub

Set of utility functions for working with the GitHub API.
Go
2
star
74

pg_info

Make it a bit easier to read the various pg_stat_* tables in PostgreSQL (WIP!)
Go
2
star
75

complete_email.vim

Allow completion of email addresses so you can use Vim as a basic "address book".
Vim Script
2
star
76

globedit.vim

Use globbing patterns for :edit, :tabedit, etc.
Vim Script
2
star
77

goathost

Shell
2
star
78

z18n

i18n library for Go
Go
2
star
79

RimWorld-RainingBlood

Example RimWorld mod
C#
2
star
80

ADVENT

Colossal Cave Adventure for modern systems, as close to the 1976 source as possible
Fortran
2
star
81

termfo

A terminfo library for Go
Go
2
star
82

jfmt

Format json, nicely
Go
2
star
83

toml-test-matrix

HTML
2
star
84

spamdb-curses

Curses tools to interface with OpenBSD's spamdb(8), which is a part of spamd(8).
Python
1
star
85

json

encoding/json with patches
Go
1
star
86

zstripe

Set of utility functions for working with the Stripe API.
Go
1
star
87

imlib2-heif

Imlib2 plugin for libheif, allowing you to load HEIF, HEIC, and AVIF images (e.g. as used by iPhones)
C
1
star
88

operapass

Read opera password files (a.k.a. "the wand").
Python
1
star
89

markdown-wiki

Simple wiki.
Ruby
1
star
90

har

Read HAR ("HTTP Archive format") files
Go
1
star
91

nordavind

Web based audio player.
CoffeeScript
1
star
92

tpad.zsh

A little script to control some various things on my ThinkPad
Shell
1
star
93

zgo.at

zgo.at website
HTML
1
star
94

synfo.vim

Print information about Vim syntax highlighting and text properties
Vim Script
1
star
95

uni-wasm

WASM demo for uni
JavaScript
1
star
96

robots

Reproduction of the 1980 โ€œclassicโ€ robots game for BSD UNIX written by Ken Arnold. You can play it in your browser at: http://arp242.net/robots/
CoffeeScript
1
star