ForbesLindesay / legacy-encoding

Support as many legacy encodings as possible
MIT License
26 stars 3 forks source link

Add aliases for utf8 and utf16 -- maybe others #4

Open cmawhorter opened 6 years ago

cmawhorter commented 6 years ago

Encoding names are inconsistent. e.g. iso-8859-1 is also available as iso8859-1 and iso_8859-1. utf-16le is also available as utf16le.

But:

There may be others.

It'd be nice if the encoding labels all had their variants built-in so that I could just read content-type: text/html; charset=utf-8 => encoding.decode(..., charset)

ForbesLindesay commented 6 years ago

That is the intention. I'd be very happy to accept a pull request to add these encodings to https://github.com/ForbesLindesay/legacy-encoding/blob/d74a4aa9199ef5ba7b41dc51e03ff6529b830cdd/index.js#L9-L12