https://github.com/optimumcode/karacteristics
KMP library that provides user with extension properties to get codepoint characteristics
https://github.com/optimumcode/karacteristics
Last synced: 2 months ago
JSON representation
KMP library that provides user with extension properties to get codepoint characteristics
- Host: GitHub
- URL: https://github.com/optimumcode/karacteristics
- Owner: OptimumCode
- License: mit
- Created: 2024-08-26T08:37:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-02-28T12:55:22.000Z (2 months ago)
- Last Synced: 2026-02-28T16:36:44.473Z (2 months ago)
- Language: Kotlin
- Size: 388 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# karacteristics
[](https://opensource.org/license/mit/)

The **karacteristics** library provides convenient extension properties to get characteristics for Unicode codepoints.
The following characteristics are available:
+ [category](https://www.unicode.org/reports/tr44/#General_Category_Values)
+ [bidirectional class](https://www.unicode.org/reports/tr44/#Bidi_Class_Values)
+ [derived property](https://www.unicode.org/Public/UNIDATA/DerivedCoreProperties.txt)
+ [joining type](https://unicode.org/Public/UNIDATA/extracted/DerivedJoiningType.txt)
The first two properties are generated using information from https://www.compart.com/en/unicode/ resource.
The latter two are generated from the corresponding files.
# Problem to solve
There is no way to get codepoint characteristics in Kotlin Multiplatform.
The available API provides only `category` property for `Char` type.
But this is no enough - some of the Unicode codepoints take more than 2 bytes (size of `Char`).
Because of that, the existing API returns incorrect information for such codepoints.
# Usage
### Supported targets
| Target |
|-------------------|
| jvm |
| js |
| wasmJs |
| wasmWasi |
| macosX64 |
| macosArm64 |
| iosArm64 |
| iosSimulatorArm64 |
| linuxX64 |
| linuxArm64 |
| mingwX64 |
The library is published to Maven Central.
To use it, just add a corresponding dependency to the common source set.
```kotlin
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("io.github.optimumcode:karacteristics:0.0.8")
}
}
}
}
```