https://github.com/janlelis/unicode-age
Determine Unicode version required to display a string
https://github.com/janlelis/unicode-age
ruby unicode unicode-data version
Last synced: 5 months ago
JSON representation
Determine Unicode version required to display a string
- Host: GitHub
- URL: https://github.com/janlelis/unicode-age
- Owner: janlelis
- License: mit
- Created: 2016-03-28T20:10:04.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2023-12-27T10:47:10.000Z (about 2 years ago)
- Last Synced: 2025-10-10T00:36:03.389Z (5 months ago)
- Topics: ruby, unicode, unicode-data, version
- Language: Ruby
- Homepage:
- Size: 28.3 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- 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::Age [![[version]](https://badge.fury.io/rb/unicode-age.svg)](https://badge.fury.io/rb/unicode-age) [![[ci]](https://github.com/janlelis/unicode-age/workflows/Test/badge.svg)](https://github.com/janlelis/unicode-age/actions?query=workflow%3ATest)
A micromodule to detect which Unicode version is required to display a string.
```ruby
Unicode::Age.of "A" # => 1.1
Unicode::Age.of "ℜսᖯʏ" # => 3.0
Unicode::Age.of "ℜ𝘂ᖯʏ" # => 3.1
Unicode::Age.of "🚡" # => 6.0
Unicode::Age.of "🛲" # => 7.0
Unicode::Age.of "🌮 " # => 8.0
Unicode::Age.of "🛒" # => 9.0
Unicode::Age.of "🛷" # => 10.0
Unicode::Age.of "\u{10FFFF}" # => nil
Unicode::Age.of "\u{10FFFD}" # => 2.0
```
Characters of status "Unassigned" (Unicode General Category of **Cn**) will raise a `Unicode::Age::UnknownAge` exception.
## Supported Ruby/Unicode versions
See the [Unicode — Ruby version table at Idiosyncratic Ruby](https://idiosyncratic-ruby.com/73-unicode-version-mapping.html)
## MIT License
Copyright (C) 2016-2022 Jan Lelis . Released under the MIT license.