{"id":27947869,"url":"https://github.com/lppedd/kotlinx-charset","last_synced_at":"2026-04-14T23:03:55.252Z","repository":{"id":291840531,"uuid":"978890295","full_name":"lppedd/kotlinx-charset","owner":"lppedd","description":"Minimal charset support for KMP","archived":false,"fork":false,"pushed_at":"2025-12-21T14:51:23.000Z","size":850,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-22T19:29:33.811Z","etag":null,"topics":[],"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/lppedd.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-06T17:01:25.000Z","updated_at":"2025-12-21T14:49:25.000Z","dependencies_parsed_at":"2025-07-08T12:59:31.352Z","dependency_job_id":"bef702b3-89bd-4efb-81d7-6b3bd536e6fd","html_url":"https://github.com/lppedd/kotlinx-charset","commit_stats":null,"previous_names":["lppedd/kotlinx-charset"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/lppedd/kotlinx-charset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lppedd%2Fkotlinx-charset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lppedd%2Fkotlinx-charset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lppedd%2Fkotlinx-charset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lppedd%2Fkotlinx-charset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lppedd","download_url":"https://codeload.github.com/lppedd/kotlinx-charset/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lppedd%2Fkotlinx-charset/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28761811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T23:06:19.311Z","status":"ssl_error","status_checked_at":"2026-01-25T23:03:50.555Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-05-07T14:38:13.063Z","updated_at":"2026-04-14T23:03:55.245Z","avatar_url":"https://github.com/lppedd.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--suppress HtmlDeprecatedAttribute --\u003e\n\u003ch1 align=\"center\"\u003ekotlinx-charset\u003c/h1\u003e\n\u003cp align=\"center\"\u003eMinimal charset support for Kotlin Multiplatform\u003c/p\u003e\n\u003cdiv align=\"center\"\u003e\n\n[![maven central](https://img.shields.io/maven-central/v/com.lppedd.kotlinx-charset/core)](https://mvnrepository.com/artifact/com.lppedd.kotlinx-charset)\n[![npm](https://img.shields.io/npm/v/%40lppedd%2Fkotlinx-charset?color=%23de1f1f\u0026logo=npm)](https://www.npmjs.com/package/@lppedd/kotlinx-charset)\n[![kotlin](https://img.shields.io/badge/kotlin-2.3.0-blue.svg?logo=kotlin)](https://kotlinlang.org)\n[![build](https://img.shields.io/github/actions/workflow/status/lppedd/kotlinx-charset/build.yml.svg?branch=master)](https://github.com/lppedd/kotlinx-charset/actions/workflows/build.yml)\n[![license](https://img.shields.io/github/license/lppedd/kotlinx-charset?color=F7F7F7)](./LICENSE)\n\n\u003c/div\u003e\n\n### Changelog\n\nSee [CHANGELOG.md](./CHANGELOG.md).\n\n### Supported Kotlin platforms\n\nAll Kotlin platforms are supported, except for Android Native.\n\n### Design considerations\n\n**kotlinx-charset** aims to be straightforward for existing JDK consumers.  \nIt replicates parts of the JDK's `Charset` API, albeit with more restrictions.\n\nThe core types you will work with are:\n\n- `XCharset` - describes a character set\n- `XCharsetDecoder` - decodes a byte sequence into characters\n- `XCharsetEncoder` - encodes characters into a byte sequence\n- `XCharsetRegistrar` - a registry and lookup service for obtaining `XCharset` instances\n\n## core\n\nThe `core` module provides the foundational components for implementing\nand registering new charsets.\n\n```kotlin\n// Create an empty charset registry\nprivate val registrar = XCharsetRegistrar()\n\n// Register a new charset\nregistrar.registerCharset(YourCharset())\n\n// Retrieve and use a charset\nval charset = registrar.getCharset(\"YourCharsetName\")\nval decoder = charset.newDecoder()\nval encoder = charset.newEncoder()\n```\n\n## ebcdic\n\nThe `ebcdic` module adds support for:\n\n```text\nIBM037  IBM930   IBM1144\nIBM273  IBM937   IBM1146\nIBM278  IBM939   IBM1147\nIBM277  IBM1047  IBM1390\nIBM280  IBM1141  IBM1399\nIBM285  IBM1142\nIBM297  IBM1143\n```\n\nYou can register supported EBCDIC charsets to your `XCharsetRegistrar`\nvia the `provideCharsets` function.\n\n```kotlin\nimport com.lppedd.kotlinx.charset.ebcdic.provideCharsets as provideEbcdicCharsets\n\n// Your shared charset registry\nprivate val registrar = XCharsetRegistrar()\n\nprovideEbcdicCharsets(registrar)\n```\n\n## exported\n\nThe `exported` module allows JS consumers to decode bytes and encode strings,\nusing top-level functions exported from ECMAScript modules.\n\n\u003e [!TIP]  \n\u003e Avoid using this module when consuming `kotlinx-charset` from a Kotlin project\n\nYou can depend on the [@lppedd/kotlinx-charset][npm] npm package.  \nFor example, consuming the library from TypeScript would look like:\n\n```ts\nimport { decode, encode, getCharset } from \"@lppedd/kotlinx-charset\";\n\nfunction funsExample(bytes: Uint8Array): Uint8Array {\n  const str = decode(\"ibm037\", bytes);\n  return encode(\"ibm037\", str);\n}\n\n// Alternatively, you can interact with a charset instance directly.\n// This allows setting or removing (by passing null) the replacement character.\nfunction instanceExample(bytes: Uint8Array): Uint8Array {\n  const charset = getCharset(\"ibm037\");\n\n  const decoder = charset.newDecoder();\n  const str = decoder.decode(bytes);\n\n  const encoder = charset.newEncoder();\n  return encoder.encode(str);\n}\n```\n\nBoth the `decode` and `encode` functions will throw an `Error`\nif the specified charset does not exist or if an error occurs\nduring data processing.\n\n## License\n\n[MIT License](./LICENSE) 2025-present [Edoardo Luppi][lppedd]\n\n[npm]: https://www.npmjs.com/package/@lppedd/kotlinx-charset\n[lppedd]: https://github.com/lppedd\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flppedd%2Fkotlinx-charset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flppedd%2Fkotlinx-charset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flppedd%2Fkotlinx-charset/lists"}