code: function getHTMLFromResponseBody(buffer, contentType) {
    const [mimeType, ...typeOptions]  = contentType.split(/;\s*/);
  
    // Pick charset from content type
    if (mimeType)
      for (let typeOption of typeOptions)
        if (/^charset=/i.test(typeOption)) {
          const charset = typeOption.split('=')[1];
          return iconv.decode(buffer, charset);
        }
  
    // Otherwise, HTML documents only, pick charset from meta tag
    // Otherwise, HTML documents only, default charset in US is windows-1252
    const charsetInMetaTag = buffer.toString().match(MATCH_CHARSET);
    if (charsetInMetaTag)
      return iconv.decode(buffer, charsetInMetaTag[1]);
    else
      return iconv.decode(buffer, 'windows-1252');
  }
docs: Extract HTML from response with the proper encoding: - If content type header indicates charset use that - Otherwise, look for <meta> tag with charset in body - Otherwise, browsers default to windows-1252 encoding