Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sail-sail/iconv_lite
Pure JS character encoding conversion
https://github.com/sail-sail/iconv_lite
Last synced: 21 days ago
JSON representation
Pure JS character encoding conversion
- Host: GitHub
- URL: https://github.com/sail-sail/iconv_lite
- Owner: sail-sail
- Created: 2022-05-16T10:13:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-10T02:58:19.000Z (over 2 years ago)
- Last Synced: 2024-10-04T13:11:51.628Z (about 1 month ago)
- Language: TypeScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# iconv_lite
Pure JS character encoding conversion
## usage
```ts
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
import { decode, encode } from "https://deno.land/x/[email protected]/mod.ts";const testString = "Hello123!";
Deno.test("utf8", function() {
const enc = "utf8";
const s = decode(encode(testString, enc).toString(enc), enc);
assertEquals(testString, s);
});Deno.test("UTF-8", function() {
const enc = "UTF-8";
const s = decode(encode(testString, enc).toString(enc), enc);
assertEquals(testString, s);
});// Deno.test("gbk", function() {
// const enc = "gbk";
// const s = decode(encode(testString, enc).toString(enc), enc);
// assertEquals(testString, s);
// });
```