https://github.com/janlelis/unicode-types
Basic Unicode Types of a Ruby String
https://github.com/janlelis/unicode-types
ruby types unicode unicode-data
Last synced: about 1 year ago
JSON representation
Basic Unicode Types of a Ruby String
- Host: GitHub
- URL: https://github.com/janlelis/unicode-types
- Owner: janlelis
- License: mit
- Created: 2016-04-15T19:41:39.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2024-12-28T22:56:53.000Z (over 1 year ago)
- Last Synced: 2025-04-14T13:57:30.820Z (about 1 year ago)
- Topics: ruby, types, unicode, unicode-data
- Language: Ruby
- Homepage:
- Size: 69.3 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: MIT-LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Unicode::Types [![[version]](https://badge.fury.io/rb/unicode-types.svg)](https://badge.fury.io/rb/unicode-types) [![[ci]](https://github.com/janlelis/unicode-types/workflows/Test/badge.svg)](https://github.com/janlelis/unicode-types/actions?query=workflow%3ATest)
Determine the basic type of codepoints. This can be one of:
- Graphic
- Format
- Control
- Private-use
- Surrogate
- Noncharacter
- Reserved
Unicode version: **16.0.0** (September 2024)
## Gemfile
```ruby
gem "unicode-types"
```
## Usage
```ruby
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](https://github.com/janlelis/unicode-x) for more Unicode related micro libraries.
## MIT License
- Copyright (C) 2016-2024 Jan Lelis . Released under the MIT license.
- Unicode data: http://www.unicode.org/copyright.html#Exhibit1