encode-utf8
Turn a string into an ArrayBuffer by using the UTF8 encoding.
Last updated 3 years ago by linusu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install encode-utf8 
SYNC missed versions from official npm registry.

Encode UTF8

Turn a string into an ArrayBuffer by using the UTF8 encoding.

Installation

npm install --save encode-utf8

Usage

import encodeUtf8 from 'encode-utf8'

console.log(encodeUtf8('Hello, World!'))
//=> ArrayBuffer { byteLength: 13 }

console.log(encodeUtf8('???? ???? ???? ????'))
//=> ArrayBuffer { byteLength: 19 }

API

encodeUtf8(input)

  • input (string, required)
  • returns ArrayBuffer - an ArrayBuffer with the input string represented as UTF8 encoded data

Current Tags

  • 2.0.0                                ...           latest (3 years ago)

5 Versions

  • 2.0.0                                ...           3 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |