#unicode-characters #unicode #command-line-tool #localization #cli

bin+lib chars

用于显示 Unicode 字符信息的命令行工具

7 个版本 (重大更改)

0.7.0 2023 年 8 月 5 日
0.6.0 2022 年 2 月 6 日
0.5.0 2020 年 3 月 20 日
0.4.1 2019 年 7 月 27 日
0.0.0 2017 年 7 月 25 日

#240国际化 (i18n)

MIT 许可证

1.5MB
5K SLoC

Cha(rs)

Build Status

使用此工具显示各种 ASCII(和 Unicode)字符/代码点的名称和代码!

它受到了 ascii(1) 的强烈启发,但支持 Unicode 字符;它也受到了 unicode.py 的启发,但试图更好地支持空白和控制字符。

Cha(rs) 目前可能在某些其他边缘情况中失败,但我希望不是。

发音

“chars”怎么发音?这是一个有争议的问题。

安装

此包在 circle CI 上使用最新的稳定、beta 和夜间版本进行了测试。旧版本可能也能工作,但我主要关注最新版本的开发。

不带源代码的纯 crate 安装

cargo install chars --git https://github.com/antifuchs/chars.git

操作系统包

Arch Linux:有一个 chars 的 AUR 包

MacOS:有一个 chars 的 Homebrew 包

Windows:通过 Chocolatey 提供一个包。

源代码安装

  1. 克隆此仓库
  2. cd 进入检查出的目录
  3. cargo安装 --路径chars

运行

通过其面值查找字符

chars'ß'

截图

LATIN1 df, 223, 0xdf, 0337, bits 11011111
Width: 1 (2 in CJK context), prints as ß
Lower case. Upcases to SS
Quotes as \u{df}
Unicode name: LATIN SMALL LETTER SHARP S

通过 Unicode 点查找字符

chars U+1F63C

截图

U+0001F63C, 😼 0x0001F63C, \0373074, UTF-8: f0 9f 98 bc, UTF-16BE: d83dde3c
Width: 1, prints as 😼
Quotes as \u{1f63c}
Unicode name: CAT FACE WITH WRY SMILE

通过模糊的“字符码”手势查找

chars10

截图

U+0001F0EA, 🃪 0x0001F0EA, \0370352, UTF-8: f0 9f 83 aa, UTF-16BE: d83cdcea
Width: 1, prints as 🃪
Quotes as \u{1f0ea}
Unicode name: PLAYING CARD TRUMP-10

U+0001DAA9, 𝪩 0x0001DAA9, \0355251, UTF-8: f0 9d aa a9, UTF-16BE: d836dea9
Width: 0, prints as 𝪩
Quotes as \u{1daa9}
Unicode name: SIGNWRITING ROTATION MODIFIER-10

U+0001D209, 𝈉 0x0001D209, \0351011, UTF-8: f0 9d 88 89, UTF-16BE: d834de09
Width: 1, prints as 𝈉
Quotes as \u{1d209}
Unicode name: GREEK VOCAL NOTATION SYMBOL-10

U+0001D1A4, 𝆤 0x0001D1A4, \0350644, UTF-8: f0 9d 86 a4, UTF-16BE: d834dda4
Width: 1, prints as 𝆤
Quotes as \u{1d1a4}
Unicode name: MUSICAL SYMBOL ORNAMENT STROKE-10

U+FE09, ︉ 0xFE09, \0177011, UTF-8: ef b8 89, UTF-16BE: fe09
Width: 0, prints as ︉
Quotes as \u{fe09}
Unicode name: VARIATION SELECTOR-10

ASCII 1/0,  16, 0x10, 0020, bits 00010000
Control character; quotes as \u{10}, called ^P
Called: DLE
Also known as: Data Link Escape

ASCII 0/a,  10, 0x0a, 0012, bits 00001010
Control character; quotes as \n, called ^J
Called: LF, NL
Also known as: Line Feed, Newline, \n

ASCII 0/8,   8, 0x08, 0010, bits 00001000
Control character; quotes as \u{8}, called ^H
Called: BS
Also known as: Backspace, \b

ASCII 0/2,   2, 0x02, 0002, bits 00000010
Control character; quotes as \u{2}, called ^B
Called: STX
Also known as: Start of Text

查找控制字符

chars"^C"

截图

ASCII 0/3,   3, 0x03, 0003, bits 00000011
Control character; quotes as \u{3}, called ^C
Called: ETX
Also known as: End of Text

依赖项

~2.5MB
~15K SLoC