Huge news!Announcing our $20M Series A led by Andreessen Horowitz.Learn more
Socket
Socket
Log inDemoInstall

is-utf8

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Issues
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

is-utf8

Detect if a buffer is utf8 encoded.

    0.2.1latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
7,299,346
decreased by-9.13%

Weekly downloads

Readme

Source

#utf8 detector

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

    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

Keywords

FAQs

Last updated on 19 Dec 2015

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install
SocketSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc