UNPKG

qb-utf8-to-str-tiny

Version:

tiny browser script for converting array of UTF-8 characters to string. not efficient for large files.

10 lines (9 loc) 264 B
module.exports = function utf8_to_str (src, off, lim) { lim = lim == null ? src.length : lim for (var i = off || 0, s = ''; i < lim; i++) { var h = src[i].toString(16) if (h.length < 2) h = '0' + h s += '%' + h } return decodeURIComponent(s) }