@lppedd/kotlinx-charset 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  ![Build status](https://github.com/lppedd/kotlinx-charset/workflows/Build/badge.svg)
4
4
  ![MIT license](https://img.shields.io/github/license/lppedd/kotlinx-charset)
5
5
  ![Kotlin 2.1.20](https://img.shields.io/badge/kotlin-2.1.20-blue.svg?logo=kotlin)
6
+ [![Maven Central](https://img.shields.io/maven-central/v/com.lppedd.kotlinx-charset/core)](https://mvnrepository.com/artifact/com.lppedd.kotlinx-charset)
6
7
 
7
8
  Minimal charset support for Kotlin Multiplatform.
8
9
 
@@ -12,7 +13,19 @@ See [CHANGELOG.md](./CHANGELOG.md).
12
13
 
13
14
  ### Supported Kotlin platforms
14
15
 
15
- All Kotlin platforms are supported, except for Android.
16
+ All Kotlin platforms are supported, except for Android Native.
17
+
18
+ ### Design considerations
19
+
20
+ **kotlinx-charset** aims to be straightforward for existing JDK consumers.
21
+ It replicates parts of the JDK's `Charset` API, albeit with more restrictions.
22
+
23
+ The core types you will work with are:
24
+
25
+ - `XCharset` - describes a character set
26
+ - `XCharsetDecoder` - decodes a byte sequence into characters
27
+ - `XCharsetEncoder` - encodes characters into a byte sequence
28
+ - `XCharsetRegistrar` - a registry and lookup service for obtaining `XCharset` instances
16
29
 
17
30
  ## core
18
31
 
@@ -27,7 +40,7 @@ private val registrar = XCharsetRegistrar()
27
40
  registrar.registerCharset(YourCharset())
28
41
 
29
42
  // Retrieve and use a charset
30
- val charset = registrar.getCharset("yourCharsetName")
43
+ val charset = registrar.getCharset("YourCharsetName")
31
44
  val decoder = charset.newDecoder()
32
45
  val encoder = charset.newEncoder()
33
46
  ```
@@ -24,6 +24,7 @@ export declare interface XCharsetEncoder {
24
24
  readonly "com.lppedd.kotlinx.charset.exported.XCharsetEncoder": unique symbol;
25
25
  };
26
26
  }
27
+ export declare function getCharsets(): Array<XCharset>;
27
28
  export declare function getCharset(charsetName: string): XCharset;
28
29
  export declare function decode(charsetName: string, bytes: Uint8Array): string;
29
30
  export declare function encode(charsetName: string, value: string): Uint8Array;