Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unilookup

A command line utility to lookup Unicode character information.

Description

Unilookup analyzes text and displays detailed information about each Unicode character in a formatted table. It shows the character position, the character itself, its Unicode codepoint, and the official Unicode character name.

Installation

From Source

git clone https://github.com/fastjack/unilookup-ruby.git
cd unilookup-ruby
bundle install

As a Gem

gem build unilookup.gemspec
gem install unilookup-0.1.0.gem

Usage

Command Line Arguments

unilookup "Hello World"
ruby bin/unilookup "Hello World"  # when running from source

Piped Input

echo "Hello World" | unilookup
cat file.txt | unilookup

Output

The utility displays results in a table format with the following columns:

  • #: Character position in the input text
  • Char: The actual Unicode character
  • Codepoint: Unicode code point in U+XXXX format
  • Name: Official Unicode character name

Examples

$ unilookup "Hi"
┌───┬──────┬───────────┬────────────────────────┐
│ # │ Char │ Codepoint │ Name                   │
├───┼──────┼───────────┼────────────────────────┤
│ 1 │  H   │ U+0048    │ LATIN CAPITAL LETTER H │
│ 2 │  i   │ U+0069    │ LATIN SMALL LETTER I   │
└───┴──────┴───────────┴────────────────────────┘
$ echo "A1!" | unilookup
┌───┬──────┬───────────┬────────────────────────┐
│ # │ Char │ Codepoint │ Name                   │
├───┼──────┼───────────┼────────────────────────┤
│ 1 │  A   │ U+0041    │ LATIN CAPITAL LETTER A │
│ 2 │  1   │ U+0031    │ DIGIT ONE              │
│ 3 │  !   │ U+0021    │ EXCLAMATION MARK       │
└───┴──────┴───────────┴────────────────────────┘

Dependencies

  • Ruby >= 2.7.0
  • unicode-name gem for character name lookup
  • tty-table gem for formatted table output

Development

# Install dependencies
bundle install

# Run tests
rake spec

# Build gem
rake build

# Run locally
ruby bin/unilookup "test text"

License

GNU General Public License v3.0

About

A command line utility to look up unicode code points

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages