Decode a response body by the charset its Content-Type names (UTF-8 when it names
none). TextDecoder drops a leading byte order mark, which Buffer#toString keeps and
JSON.parse then rejects, so a BOM added by a proxy cannot turn a valid answer into
a parse error, and an iso-8859-1 body keeps its umlauts. An unknown charset label
is a DipParseError naming it after request, the request it answered
(GET <url>: unsupported response charset "…".). Bytes that are not valid in the charset
become U+FFFD (getJson reports how many through onWarning).
Decode a response body by the charset its Content-Type names (UTF-8 when it names none). TextDecoder drops a leading byte order mark, which Buffer#toString keeps and JSON.parse then rejects, so a BOM added by a proxy cannot turn a valid answer into a parse error, and an
iso-8859-1body keeps its umlauts. An unknown charset label is aDipParseErrornaming it afterrequest, the request it answered (GET <url>: unsupported response charset "…".). Bytes that are not valid in the charset become U+FFFD (getJsonreports how many throughonWarning).