Unicode::Name
![[travis]](https://travis-ci.org/janlelis/unicode-name.png)
Return Unicode codepoint names, aliases, and labels.
Unicode version: 10.0.0
Supported Rubies: 2.5, 2.4, 2.3
Old Rubies that might still work: 2.2, 2.1, 2.0
Usage
require "unicode/name"
# Name
Unicode::Name.of "A" # => "LATIN CAPITAL LETTER A"
Unicode::Name.of "π‘" # => "AERIAL TRAMWAY"
Unicode::Name.of "δΈ" # => "CJK UNIFIED IDEOGRAPH-4E01"
Unicode::Name.of "ν" # => "HANGUL SYLLABLE HAN"
# Aliases, by type
Unicode::Name.aliases "\t" # => {:control=>["CHARACTER TABULATION", "HORIZONTAL TABULATION"],
:abbreviation=>["HT", "TAB"]}
# Corrections (via .aliases[:correction], then name)
Unicode::Name.correct "A" # => "LATIN CAPITAL LETTER A"
Unicode::Name.correct "Ζ’" # => "LATIN CAPITAL LETTER GHA"
# Codepoint labels
Unicode::Name.label("\0") # => "<control-0000>"
Unicode::Name.label("\u{D800}") # => "<surrogate-D800>"
Unicode::Name.label("\u{FFFFF}") # => "<noncharacter-FFFFF>"
Unicode::Name.label("\u{10C50}") # => "<reserved-10C50>"
# Best readable representation
Unicode::Name.readable("A") # => "LATIN CAPITAL LETTER A"
Unicode::Name.readable("\0") # => "NULL"
Unicode::Name.readable("\u{FFFFD}") # => "<private-use-FFFFD>"
See unicode-x for more Unicode related micro libraries.
MIT License
- Copyright (C) 2016-2018 Jan Lelis http://janlelis.com. Released under the MIT license.
- Unicode data: http://www.unicode.org/copyright.html#Exhibit1