is-utf8

WebJar for is-utf8

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

is-utf8
Last Version

Last Version

0.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

is-utf8
WebJar for is-utf8
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/wayfind/is-utf8

Download is-utf8

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/is-utf8/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>is-utf8</artifactId>
    <version>0.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/is-utf8/
implementation 'org.webjars.npm:is-utf8:0.2.1'
// https://jarcasting.com/artifacts/org.webjars.npm/is-utf8/
implementation ("org.webjars.npm:is-utf8:0.2.1")
'org.webjars.npm:is-utf8:jar:0.2.1'
<dependency org="org.webjars.npm" name="is-utf8" rev="0.2.1">
  <artifact name="is-utf8" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='is-utf8', version='0.2.1')
)
libraryDependencies += "org.webjars.npm" % "is-utf8" % "0.2.1"
[org.webjars.npm/is-utf8 "0.2.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

#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

Versions

Version
0.2.1
0.2.0