# qb-utf8-to-str-tiny

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

Latest version **1.2.2** (published 2023-06-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install qb-utf8-to-str-tiny
pnpm add qb-utf8-to-str-tiny
yarn add qb-utf8-to-str-tiny
bun add qb-utf8-to-str-tiny
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2023-06-17 |
| First published | 2017-02-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matthew Voss |
| Maintainers | mvoss9000 |
| Keywords | UTF8, UTF-8, encode, decode, browser |

## Links

- npm: https://www.npmjs.com/package/qb-utf8-to-str-tiny
- Repository: https://github.com/quicbit-js/qb-utf8-to-str-tiny
- Issues: https://github.com/quicbit-js/qb-utf8-to-str-tiny/issues
- npm.io page: https://npm.io/package/qb-utf8-to-str-tiny

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads
- [datasets-fi-postalcodes](https://npm.io/package/datasets-fi-postalcodes.md) — 1.1K weekly downloads

## Recent versions

- 1.2.2 (latest) — 2023-06-17
- 1.2.1 — 2017-03-21
- 1.2.0 — 2017-03-21
- 1.1.3 — 2017-03-17
- 1.1.2 — 2017-03-06
- 1.1.1 — 2017-03-06
- 1.0.1 — 2017-02-19
- 1.0.0 — 2017-02-17

## README

# qb-utf8-to-str-tiny

[![npm][npm-image]][npm-url]
[![downloads][downloads-image]][npm-url]
[![bitHound Dependencies][proddep-image]][proddep-link]
[![dev dependencies][devdep-image]][devdep-link]
[![code analysis][code-image]][code-link]

[npm-image]:       https://img.shields.io/npm/v/qb-utf8-to-str-tiny.svg
[downloads-image]: https://img.shields.io/npm/dm/qb-utf8-to-str-tiny.svg
[npm-url]:         https://npmjs.org/package/qb-utf8-to-str-tiny
[proddep-image]:   https://www.bithound.io/github/quicbit-js/qb-utf8-to-str-tiny/badges/dependencies.svg
[proddep-link]:    https://www.bithound.io/github/quicbit-js/qb-utf8-to-str-tiny/master/dependencies/npm
[devdep-image]:    https://www.bithound.io/github/quicbit-js/qb-utf8-to-str-tiny/badges/devDependencies.svg
[devdep-link]:     https://www.bithound.io/github/quicbit-js/qb-utf8-to-str-tiny/master/dependencies/npm
[code-image]:      https://www.bithound.io/github/quicbit-js/qb-utf8-to-str-tiny/badges/code.svg
[code-link]:       https://www.bithound.io/github/quicbit-js/qb-utf8-to-str-tiny

Tiny script for converting utf-8 to string based upon decodeURIComponent().  
Runs in nodejs and in browser.  Not efficient for large strings.

    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)
    }

That's it.  That's the code.

**Complies with the 100% test coverage and minimum dependency requirements** of 
[qb-standard](http://github.com/quicbit-js/qb-standard) . 

# Install

    npm install qb-utf8-to-str-tiny

## Example

    npm install qb-utf8-to-str-tiny
    
    node
    > var utf2str = require('qb-utf8-to-str-tiny')
    > utf2str([ 103,195,174,100,100,195,177,117,112,240,144,130,131,33 ])
    'gîddñup𐂃!'


## API

### utf8_to_str (src, off, lim)

* [src](https://github.com/quicbit-js/qb-standard/blob/master/doc/variable-glossary.md#src-source): an 
array or typed-array containing bytes or unsigned integers in UTF-8 format. 

* [off](https://github.com/quicbit-js/qb-standard/blob/master/doc/variable-glossary.md#off-offset): an 
inclusive byte offset where to start conversion

* [lim](https://github.com/quicbit-js/qb-standard/blob/master/doc/variable-glossary.md#lim-limit): an
exclusive byte offset where to stop conversion

---
_Source: https://npm.io/package/qb-utf8-to-str-tiny · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
