title: Parse quoted-printable encoding content from .mht file
body: <p>I am trying to get all the images from .mht file by using Nokogiri gem. But since the .mht file has quoted-printable encoding, all the images that I received, has weird characters in it:</p>
  <pre><code>&lt;img alt='3D&quot;AFC-Logo' src=&quot;3D%22https://upload.=&quot; width='3D&quot;75&quot;' height='3D&quot;75&quot;'&gt;
  &lt;img src=&quot;3D%22https://en.wikipedia.org/static/images/footer/wikimedia-butto=&quot; width='3D&quot;88&quot;' height='3D&quot;31&quot;' alt='3D&quot;Wikimedia'&gt;
  &lt;img src=&quot;3D%22https://en.wikipedia.org/static/images/footer/poweredby_mediawiki_8=&quot; alt='3D&quot;Powered' width='3D&quot;88&quot;' height='3D&quot;31&quot;'&gt;
  </code></pre>
  <p>This is the link to that .mht file: <a href="https://drive.google.com/file/d/1DtbgrFyCEcggAk1nqpZSluNhRt-k3t95/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1DtbgrFyCEcggAk1nqpZSluNhRt-k3t95/view?usp=sharing</a></p>
  <p>And below is the code that I am using to get all the images from the .mht file:</p>
  <pre><code>html = File.open(&quot;1646037951.mht&quot;).read
  image_links = get_image_links(html)
  
  def get_image_links(html)
    html_doc = Nokogiri::HTML(html)
    nodes = html_doc.xpath(&quot;//img[@src]&quot;)
    raise &quot;No &lt;img .../&gt; tags!&quot; if nodes.empty?
    nodes.inject([]) do |uris, node|
       puts node.to_s
       uris &lt;&lt; node.attr('src').strip
    end.uniq
  end
  </code></pre>
  <p>I have tried to parse it by using <code>.unpack('M').first</code> but it's still not working as it just returns the same result as above.</p>
  <p>Or maybe Rails have something for this?</p>