How to use is-utf8 - 2 common examples

To help you get started, we’ve selected a few is-utf8 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fanpei91 / torsniff / src / utils.js View on Github external
toUtf8String(buffer){
    if(isUtf8(buffer)){
      return buffer.toString();
    }
    return iconvLite.decode(buffer, 'GB18030');
  }
};
github bids-standard / bids-validator / bids-validator / utils / files / readFile.js View on Github external
const checkEncoding = (file, data, cb) => {
  if (isJSONFile(file)) cb({ isUtf8: checkIfUtf8(data) })
}

is-utf8

Detect if a buffer is utf8 encoded.

MIT
Latest version published 9 years ago

Package Health Score

67 / 100
Full package analysis

Popular is-utf8 functions