Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

charset-detector

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

charset-detector

ICU based port of charset detection

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.8K
increased by62.98%
Maintainers
1
Weekly downloads
 
Created
Source

node-charset-detector

ICU based port of charset detection to javascript

Install

npm install --save charset-detector

Use

var detect = require('charset-detector');

/*
  function accept node Buffer, but will work with anything that follow such rules:
  allow indexing by []
  has .length
  each numbered property is byte 0-255
*/
var matches = detect(buffer);

Function will return array of matches sorted by most confident first.

Detectable encodings from ICU:

  • UTF8 (with and without BOM)
  • UTF16-LE, UTF16-BE, UTF32-LE, UTF32-BE
  • Big5, EUC-JP, GB18030, Shift_JIS
  • ISO-2022-JP, ISO-2022-KR, ISO-2022-CN
  • ISO-8859-1, ISO-8859-2, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-8-I, ISO-8859-9, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, koir8-r, IBM420_ltr(rtl), IBM424_ltr(rtl)

Keywords

FAQs

Package last updated on 22 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc