title: "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xad in position 2491: invalid start byte"
body: <p>In this code:</p>
  
  <pre><code>subprocess.getoutput('./pdftotext file.pdf -')
  </code></pre>
  
  <p>Also I tried <code>UTF-16</code>:</p>
  
  <pre><code>subprocess.check_output('./pdftotext file.pdf -', shell=True, encoding='utf-16')
  </code></pre>
  
  <p>The PDF from <a href="https://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf" rel="nofollow noreferrer">https://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf</a>, but I see the same error (with another byte value) for another PDF.</p>
  
  <p>This PDF from Mozilla behaves well with pure Bash without Python.</p>
  
  <p>Also I tried param <code>universal_newlines=True</code>, for example:</p>
  
  <pre><code>return subprocess.run(
        './pdftotext file.pdf -',
        shell=True,
        stdout=subprocess.PIPE,
        universal_newlines=True
  ).stdout
  </code></pre>
  
  <p>Python 3.6 on Lambda.</p>