kotone
v1.3.0
Published
Transform file to UTF-8 by Rust
Downloads
7
Maintainers
Readme
kotone
Transform file to UTF-8 by Rust.
Install
pnpm i -D kotone
Usage
import fs from 'fs'
import { transform } from 'kotone' // or import `transformSync`
const buffer = fs.readFileSync('file.txt')
const utf8 = await transform(buffer)
fs.writeFileSync("file-utf8.txt", utf8, 'utf-8')
Forced encoding of source code specified:
// transform `shift_jis` to `utf-8`
const utf8 = await transform(buffer, 'shift_jis')
fs.writeFileSync("file-utf8.txt", utf8, 'utf-8')
Thanks/Inspiration
- sjis-utf8: A small Node CLI for converting Shift-JIS encoded file into a UTF-8 encoded file.
License
MIT