0.0
A long-lived project that still receives updates
[Unicode 14.0.0] Determines the very basic type of codepoints (one of: Graphic, Format, Control, Private-use, Surrogate, Noncharacter, Reserved)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Dependencies
 Project Readme

Unicode::Types [version] [ci]

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

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

Unicode version: 14.0.0 (September 2021)

Supported Rubies: 3.0, 2.7

Old Rubies that might still work: 2.6, 2.5, 2.4, 2.3, 2.2, 2.1, 2.0

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