#36 Correctly decode using the original document charset and force re-encoding via UTF-8 BOM only when needed.
Merged by quidam. Opened by gioma1.
gioma1/librejs fix/charset  into  master

Download 36.patch
  1. Simplified the ResponseMetaData class by removing all the UTF-8 forced signaling machinery
  2. Made ResponseMetaData standard-compliant by defaulting to "latin1" for decoding when no charset information is provided by the server.
  3. Using the BOM, rather than HTTP headers, as a more robust and timely means to enforce UTF-8 re-encoding when (and only when) we actually had to modify the response content.
  4. Added sniffing of in-content charset information ( tags and BOM) when it's not delivered by HTTP headers.

All this should fix a whole bunch of decoding and encoding bugs, including https://lists.gnu.org/archive/html/bug-librejs/2019-02/msg00004.html and http://savannah.gnu.org/bugs/?54857

Pull-Request has been merged by quidam

Metadata