【文件属性】:
文件名称:encode-utf8:使用 UTF8 编码将字符串转换为 ArrayBuffer
文件大小:4KB
文件格式:ZIP
更新时间:2021-08-04 13:18:15
JavaScript
编码 UTF8
使用 UTF8 编码将字符串转换为 ArrayBuffer。
安装
npm install -- save encode - utf8
用法
import encodeUtf8 from 'encode-utf8'
console . log ( encodeUtf8 ( 'Hello, World!' ) )
//=> ArrayBuffer { byteLength: 13 }
console . log ( encodeUtf8 ( ':monkey_face: :see-no-evil_monkey: :hear-no-evil_monkey: :speak-no-evil_monkey:' ) )
//=> ArrayBuffer { byteLength: 19 }
应用程序接口
encodeUtf8(input)
input ( string ,必填)
返回ArrayBuffer - 一个 ArrayBuffer, input字符串表示为 UTF8 编码数据
【文件预览】:
encode-utf8-master
----index.js(1KB)
----test.js(2KB)
----package.json(419B)
----readme.md(519B)
----.github()
--------workflows()
----index.d.ts(152B)
----.gitignore(15B)
----.npmrc(19B)