Skip to content

Commit

Permalink
Version 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cketti committed Jan 31, 2023
1 parent 1b30575 commit 8f93526
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [0.4.0] - 2023-01-31
### Changed
- `CodePoints.toChars(Int, CharArray, Int)` is now bug-compatible with `java.lang.Character.toChars(int, char[], int)`.
Using an offset of -1 will lead to an exception, but the first element of the destination might be modified.

### Added
- Support for MIPS targets
- Separate library `kotlin-codepoints-deluxe` that builds a nicer API on top of `kotlin-codepoints`

## [0.3.0] - 2023-01-24
### Changed
- Changed JVM target version from 11 to 1.8
Expand Down
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ kotlin-codepoints is distributed through Maven Central.

```kotlin
dependencies {
implementation("de.cketti.unicode:kotlin-codepoints:0.3.0")
// Basic API
implementation("de.cketti.unicode:kotlin-codepoints:0.4.0")

// or

// Nice API
implementation("de.cketti.unicode:kotlin-codepoints-deluxe:0.4.0")
}
```

## Features

### kotlin-codepoints

This library aims to make some methods of the Java standard library available to Kotlin multiplatform projects.

Methods found in `java.lang.String`:
Expand All @@ -42,6 +50,36 @@ Methods found in `java.lang.Character`:
On the JVM the platform implementation is used. On all other platforms the
[implementation in this library](src/commonImplementation/kotlin) is used.

### kotlin-codepoints-deluxe

This library builds on top of `kotlin-codepoints`. It adds a the `CodePoint` class to make working with code points a
bit less painful.

Until someone gets around to building and publishing proper documentation,
see [CodePoint.kt](https://github.com/cketti/kotlin-codepoints/blob/main/kotlin-codepoints-deluxe/src/commonMain/kotlin/CodePoint.kt)
to get and idea of what's available.

#### Example:
```kotlin
val text = "🦕&🦖"

for (codePoint in text.codePointSequence()) {
print("code point: $codePoint, char count: ${codePoint.charCount}")

if (codePoint.isBasic) {
println(" - boring!")
} else {
println()
}
}

// Output:
// -------
// code point: U+1F995, char count: 2
// code point: U+0026, char count: 1 - boring!
// code point: U+1F996, char count: 2
```


## License

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=de.cketti.unicode
VERSION_NAME=0.4.0-SNAPSHOT
VERSION_NAME=0.4.0

POM_INCEPTION_YEAR=2023

Expand Down

0 comments on commit 8f93526

Please sign in to comment.