The karacteristics library provides convenient extension properties to get characteristics for Unicode codepoints. The following characteristics are available:
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.
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.
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 {
sourceSets {
commonMain {
dependencies {
implementation("io.github.optimumcode:karacteristics:0.0.3")
}
}
}
}