python-archieve-projects/WechatBot/node_modules/encode-utf8
Lee2vv 0b82373111 init 2024-05-05 13:46:50 +08:00
..
index.d.ts Backup 2023-08-18 21:52:54 +08:00
index.js init 2024-05-05 13:46:50 +08:00
package.json Backup 2023-08-18 21:52:54 +08:00
readme.md Backup 2023-08-18 21:52:54 +08:00
test.js init 2024-05-05 13:46:50 +08:00

readme.md

Encode UTF8

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

Installation

npm install --save encode-uf8

Usage

const encodeUtf8 = require('encode-utf8')

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

console.log(encodeUtf8('🐵 🙈 🙉 🙊'))
//=> ArrayBuffer { byteLength: 19 }

API

encodeUtf8(input: string): ArrayBuffer

Returns an ArrayBuffer with the string represented as UTF8 encoded data.