Skip to content

mkyutani/unicode-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unicode tools

Search unicode character and character sequences:

  • by character name
  • by character code
  • by unicode block

This tool depends on unicode 15.0 definition files.

Usage

Simple search by name

ucsearch searches characters by name in local unicode database created by uccreatedatabase (see Install and initialize tools section), and prints character, code point or code point sequence, and name or description.

Simple search

Search by detail

ucsearch with --detail option searches characters by detail and prints result. Detail is stored from kDefinition tag of CJK characters.

Search by detail

Search by code range

ucsearch with --code option searches characters by code range and prints result.

Search by code range

Search by character

ucsearch with --char option searches characters by character and prints result.

Search by character

Search by block name

ucsearch with --block option search characters by block name and prints result.

Search by block name

Applications not supporting complex emoji and zwj sequences

In the case described above, you may see two letters instead of the national flag of Norway in your terminal.

Sample to copy Norway's flag in twitter

Even if so, when you copy first two letters NO (\u1f1f3\u1f1f4) and paste them in browser, twitter's tweet textbox for example, you can see the national flag of Norway.

Sample to paste Norway's flag in twitter

The same applies to zwf sequences.

In terminal without any fonts:

Sample to copy polar bear in twitter

In twitter's tweet textbox:

Sample to paste polar bear in twitter

Options

--strict

Searches characters completely matched (but case insensitive).

Search with --strict

--format {utf8,simple}

Prints result in various format.

  • 'utf8': Prints utf-8 instead of utf-32.
  • 'simple': Prints characters only. This option may be used in pipe.

Search with --format

--first

Prints the first result only. This option may be used in pipe.

Search with --first

--delimiter

Prints result with the specified delimiter instead of space (0x20).

Print with --delimiter

Install and initialize tools

Install by pip3.

$ pip3 install git+https://github.com/mkyutani/unicode-tools.git

uccreatedatabase command initializes unicode database.

$ uccreatedatabase

This command creates a file ~/.local/share/applications/unicode.db, which is an sqlite3 file consuming about 13MB for unicode 15.0.

Remove tools

ucdeletedatabase removes unicode database.

$ ucdeletedatabase

This command removes ~/.local/share/applications/unicode.db.

Print database information

ucdatabaseinfo prints database information.

$ ucdatabaseinfo
/home/username/.local/share/applications/unicode.db

About

Unicode command tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages