Skip to content

A Node.js library for converting HTML documents of arbitrary encoding to UTF-8

License

Notifications You must be signed in to change notification settings

spect88/html-to-utf8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

html-to-utf8

A Node.js library for converting HTML documents of arbitrary encoding to UTF-8.

Installation

npm install html-to-utf8

Usage

var request = require('request');
var toUTF8 = require('html-to-utf8');

request({
  url: 'http://www.rakuten.co.jp',
  encoding: null // stop request from decoding response
}, function(err, resp, buffer) {
  if (err) {
    console.error(err.stack);
    return;
  }

  var htmlInUTF8 = toUTF8(buffer, resp.headers['content-type']);
});

License

The code is available under MIT license.

About

A Node.js library for converting HTML documents of arbitrary encoding to UTF-8

Resources

License

Stars

Watchers

Forks

Packages

No packages published