$ cnpm install utf8-bytes
return an array of all the bytes in a unicode string
This module is like Buffer(str).toJSON(), but without using Buffer.
var bytes = require('utf8-bytes');
console.log(bytes('[☉,☼]'));
output:
$ node example/utf8-bytes.js
[ 91, 226, 152, 137, 44, 226, 152, 188, 93 ]
var bytes = require('utf8-bytes')
Return an array of integers from 0 through 255, inclusive, representing the
bytes in the unicode string str.
With npm do:
npm install utf8-bytes
MIT
Copyright 2013 - present © cnpmjs.org | Home |