Charset Parser
- Node.js module
- Parse charset string from http header and html data
Installation
npm install charset-parser --save
Usage
- Input a string, the charsetParser will find the charset string
// charsetParser(string);var charset = ;
- Input: the content type from http header, binary html content and a default charset
- If http header has no charset defined, the binary content will parse, if there is also no charset, it returns the default
// charsetParser(header, html, default_charset);var charset = ;
Example
- A small example with node.js modules 'request' and 'iconv-lite'
var request = ;var iconv = ;var charsetParser = ; iconv;
Test
npm installnpm test
Release History
- 0.2.0 Add more input parameters
- 0.1.0 Initial release