Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Multiplatform: Add iOS target. #834

Merged
merged 1 commit into from
Jun 26, 2024
Merged

Multiplatform: Add iOS target. #834

merged 1 commit into from
Jun 26, 2024

Conversation

vanniktech
Copy link
Owner

@vanniktech vanniktech commented May 26, 2022

No description provided.

@vanniktech vanniktech force-pushed the multiplatform-ios branch 2 times, most recently from 421f9f7 to 324d27b Compare May 26, 2022 09:46
@vanniktech vanniktech force-pushed the multiplatform-ios branch 2 times, most recently from 4bf3898 to 403ba7a Compare July 28, 2022 19:43
@Caij
Copy link

Caij commented Aug 1, 2023

@vanniktech
Copy link
Owner Author

Yes I saw it but last time I checked, they don't have a constructor for the code points on string, or am I overseeing something?

@vanniktech vanniktech force-pushed the multiplatform-ios branch 5 times, most recently from da2d4e9 to baadb5c Compare December 10, 2023 16:29
@cketti
Copy link
Contributor

cketti commented Jun 23, 2024

You can use StringBuilder.appendCodePoint() to build a string from a list of code points.

I'm also happy to add a helper function to the library. Maybe something like this?

fun stringFromCodePoints(vararg codePoints: Int): String {
    val charCount = codePoints.sumOf { CodePoints.charCount(it) }
    return buildString(capacity = charCount) {
        for (codePoint in codePoints) {
            appendCodePoint(codePoint)
        }
    }
}

@vanniktech
Copy link
Owner Author

I'm following your library and yes I think cketti/kotlin-codepoints#40 would unblock this.

@cketti
Copy link
Contributor

cketti commented Jun 25, 2024

The functionality is available via CodePoints.toString(…) in de.cketti.unicode:kotlin-codepoints:0.9.0. The API isn't particularly stable, though. You probably want to wrap the library call with your own function so you don't have to change a lot of places should the name of the library function change in a future release.

@vanniktech vanniktech force-pushed the multiplatform-ios branch 3 times, most recently from 05c92e3 to 23f65ba Compare June 25, 2024 05:41
@vanniktech vanniktech marked this pull request as ready for review June 25, 2024 06:07
@vanniktech vanniktech merged commit 4fb3246 into master Jun 26, 2024
2 checks passed
@vanniktech vanniktech deleted the multiplatform-ios branch June 26, 2024 10:21
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants