You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Encodes a string to UTF-8 encoded bytes. https://en.wikipedia.org/wiki/UTF-8
4
+
Decodes UTF-8 bytes to a string.
4
5
5
6
- No dependencies.
6
7
- Small code size and simple implementation that you can copy paste.
7
8
8
-
This can act as a polyfill for `TextEncoder` if you only need UTF-8 encoding. Useful when the `TextEncoder`is undefined in places like the `AudioWorklet` API in browsers. See https://github.com/rustwasm/wasm-bindgen/issues/2367 for more info.
9
+
This can act as a polyfill for `TextEncoder`and `TextDecoder`if you only need UTF-8 encoding/decoding. Useful when `TextEncoder`and `TextDecoder` are undefined in places like the `AudioWorklet` API in browsers. Seehttps://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Using_AudioWorklet andhttps://github.com/rustwasm/wasm-bindgen/issues/2367 for more info.
9
10
10
11
## Usage
11
12
@@ -18,9 +19,12 @@ or
18
19
```
19
20
pnpm add @haribala/text-encoder-utf-8
20
21
```
21
-
Then import `encode` which takes a `string` and returns a `Uint8array`
0 commit comments