{"id":17960275,"url":"https://github.com/cketti/kotlin-codepoints","last_synced_at":"2025-04-13T10:40:57.318Z","repository":{"id":65409600,"uuid":"589761608","full_name":"cketti/kotlin-codepoints","owner":"cketti","description":"Kotlin Multiplatform (KMP) library that adds basic support for Unicode code points","archived":false,"fork":false,"pushed_at":"2025-03-21T14:24:03.000Z","size":257,"stargazers_count":114,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-21T15:26:06.819Z","etag":null,"topics":["codepoints","kotlin","kotlin-multiplatform"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cketti.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-16T21:50:50.000Z","updated_at":"2025-03-21T14:09:42.000Z","dependencies_parsed_at":"2024-03-02T03:25:30.735Z","dependency_job_id":"fc64bb4c-325f-4d15-a0d1-2b3e8406152c","html_url":"https://github.com/cketti/kotlin-codepoints","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cketti%2Fkotlin-codepoints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cketti%2Fkotlin-codepoints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cketti%2Fkotlin-codepoints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cketti%2Fkotlin-codepoints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cketti","download_url":"https://codeload.github.com/cketti/kotlin-codepoints/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248701072,"owners_count":21147972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codepoints","kotlin","kotlin-multiplatform"],"created_at":"2024-10-29T11:05:56.974Z","updated_at":"2025-04-13T10:40:57.279Z","avatar_url":"https://github.com/cketti.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kotlin-codepoints\n\nKotlin Multiplatform (KMP) library that adds basic support for Unicode code points. \n\n**Note:** This library is a side project and work in progress. When evaluating whether to use this in production, please\nconsider this project unmaintained. That being said, contributions are welcome. But don't expect fast responses.\n\n## Installation\nkotlin-codepoints is distributed through Maven Central.\n\n```kotlin\ndependencies {\n    // Basic API\n    implementation(\"de.cketti.unicode:kotlin-codepoints:0.9.0\")\n\n    // or\n    \n    // Nice API\n    implementation(\"de.cketti.unicode:kotlin-codepoints-deluxe:0.9.0\")\n}\n```\n\n## Features\n\n### kotlin-codepoints\n\nThis library aims to make some methods of the Java standard library available to Kotlin multiplatform projects.\n\nMethods found in `java.lang.String`:\n* `CharSequence.codePointAt(index)`\n* `CharSequence.codePointBefore(index)`\n* `CharSequence.codePointCount(beginIndex, endIndex)`\n* `CharSequence.offsetByCodePoints(index, codePointOffset)`\n\nMethods found in `java.lang.StringBuilder`:\n* `Appendable.appendCodePoint(codePoint)`\n\nMethods found in `java.lang.Character`: \n* `CodePoints.isValidCodePoint(codePoint)`\n* `CodePoints.isBmpCodePoint(codePoint)`\n* `CodePoints.isSupplementaryCodePoint(codePoint)`\n* `CodePoints.charCount(codePoint)`\n* `CodePoints.isSurrogatePair(highSurrogate, lowSurrogate)`\n* `CodePoints.highSurrogate(codePoint)`\n* `CodePoints.lowSurrogate(codePoint)`\n* `CodePoints.toCodePoint(highSurrogate, lowSurrogate)`\n* `CodePoints.toChars(codePoint)`\n* `CodePoints.toChars(codePoint, destination, offset)`\n\nOn the JVM the platform implementation (`java.lang.Character.*`) is used. On all other platforms the \n[implementation in this library](src/commonImplementation/kotlin) is used.\n\n### kotlin-codepoints-deluxe\n\nThis library builds on top of `kotlin-codepoints`. It adds a the `CodePoint` class to make working with code points a \nbit less painful.\n\nUntil someone gets around to building and publishing proper documentation, \nsee [CodePoint.kt](https://github.com/cketti/kotlin-codepoints/blob/main/kotlin-codepoints-deluxe/src/commonMain/kotlin/CodePoint.kt)\nto get and idea of what's available.\n\n#### Example:\n```kotlin\nval text = \"🦕\u0026🦖\"\n\nfor (codePoint in text.codePointSequence()) {\n    print(\"code point: ${codePoint.toUnicodeNotation()}, char count: ${codePoint.charCount}\")\n\n    if (codePoint.isBasic) {\n        println(\" - boring!\")\n    } else {\n        println()\n    }\n}\n\n// Output:\n// -------\n// code point: U+1F995, char count: 2\n// code point: U+0026, char count: 1 - boring!\n// code point: U+1F996, char count: 2\n```\n\n\n## License\n\n```text\nMIT License\n\nCopyright (c) 2023 cketti\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcketti%2Fkotlin-codepoints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcketti%2Fkotlin-codepoints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcketti%2Fkotlin-codepoints/lists"}