utf8-to-ansi

1.0.3 • Public • Published

utf8ToAnsi

A utility to convert utf8 string to ansi windows-874

Installation

yarn add utf8-to-ansi or npm install utf8-to-ansi

Example

To get ansi string from utf8 string

import { utf8ToAnsi } from 'utf8-to-ansi'

const utf8 = 'สวัสดีชาวโลก'
const ansi = utf8ToAnsi(utf8)
console.log(ansi)

To get byte array from utf8 string

import { toByteArray } from 'utf8-to-ansi'

const buffer = new Buffer.from(toByteArray('ทดสอบ สมมุติ'))
console.log(buffer.toString('latin1'))

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    664
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    664
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i utf8-to-ansi

Weekly Downloads

664

Version

1.0.3

License

MIT

Unpacked Size

3.03 kB

Total Files

8

Last publish

Collaborators

  • topscores