$ gnpm install encode-utf8
Turn a string into an ArrayBuffer by using the UTF8 encoding.
npm install --save encode-utf8
import encodeUtf8 from 'encode-utf8'
console.log(encodeUtf8('Hello, World!'))
//=> ArrayBuffer { byteLength: 13 }
console.log(encodeUtf8('???? ???? ???? ????'))
//=> ArrayBuffer { byteLength: 19 }
encodeUtf8(input)
input
(string
, required)ArrayBuffer
- an ArrayBuffer with the input
string represented as UTF8 encoded dataCopyright 2013 - present © cnpmjs.org | Home |