Unicode::Types [version] [travis]

Determine the basic type of codepoints. This can be one of:

  • Graphic
  • Format
  • Control
  • Private-use
  • Surrogate
  • Noncharacter
  • Reserved

Unicode version: 8.0.0

Supported Rubies: 2.3, 2.2, 2.1

Gemfile

gem "unicode-types"

Usage

require "unicode/types"

# All general types of a string
Unicode::Types.types("A\tb") # => ["Control", "Graphic"]

# Also aliased as .of 
Unicode::Types.of("\u{FFFFF}") # => ["Noncharacter"]

# Single codepoint
Unicode::Types.type("\u{FFFFD}") # => "Reserved"

The list of types is always sorted alphabetically.

See unicode-x for more Unicode related micro libraries.

MIT License