# is-utf8

> Detect if a buffer is utf8 encoded.

Latest version **0.2.1** (published 2015-12-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-utf8
pnpm add is-utf8
yarn add is-utf8
bun add is-utf8
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2015-12-19 |
| First published | 2012-09-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/is-utf8) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 106 |
| Author | wayfind |
| Maintainers | wayfind |
| Keywords | utf8, charset |

## Links

- npm: https://www.npmjs.com/package/is-utf8
- Repository: https://github.com/wayfind/is-utf8
- Homepage: https://github.com/wayfind/is-utf8#readme
- Issues: https://github.com/wayfind/is-utf8/issues
- npm.io page: https://npm.io/package/is-utf8

## Recent versions

- 0.2.1 (latest) — 2015-12-19
- 0.2.0 — 2012-09-12
- 0.1.0 — 2012-09-12

## README

#utf8 detector

Detect if a Buffer is utf8 encoded. 
It need The minimum amount of bytes is 4.


```javascript
    var fs = require('fs');
    var isUtf8 = require('is-utf8');
    var ansi = fs.readFileSync('ansi.txt');
    var utf8 = fs.readFileSync('utf8.txt');
    
    console.log('ansi.txt is utf8: '+isUtf8(ansi)); //false
    console.log('utf8.txt is utf8: '+isUtf8(utf8)); //true
```

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