title: Decode Base64 in Python that was encoded in Perl
body: <p>I have base64 encoded data that was created with Perl, using <code>MIME::Base64</code> with <code>encode_base64($data)</code>.</p>
  
  <p>The result is: <code>ahX/OxLY/BBR4Wy+n+a3Mg==</code></p>
  
  <p>When I decode this in Perl, I get <code>j?;??Q?l???2</code>. If I write that out to a file, it looks like this: <code>jˇ;ÿ¸Q·læüÊ∑2</code></p>
  
  <p>However, when I try to use the same base64 encoded data and decode with python <code>base64.b64decode(data), I get:
  </code>b'j\x15\xff;\x12\xd8\xfc\x10Q\xe1l\xbe\x9f\xe6\xb72'`</p>
  
  <p>If I decoded it to <code>latin1</code>, the result is a bit closer: <code>'j\x15ÿ;\x12Øü\x10Qál¾\x9fæ·2'</code>, but I need the exact same data.</p>
  
  <p>How can I get the exact same output from python? What am I missing?</p>
  
  <p>(The Perl <code>$data</code> itself was supposedly generated with urandom <code>read(DEV,$data,16);</code>. </p>