Python3 change string to byte
<p>I'm using Python3.5 and I want to change <code>\xe1BA\x06\xbe\x084</code> into <code>b'\xe1BA\x06\xbe\x084'</code></p>

<p>But using <code>'\xe1BA\x06\xbe\x084'.encode('ascii')</code> or <code>'\xe1BA\x06\xbe\x084'.encode('utf-8')</code>doesn't work.</p>

<p>In <code>.encode('utf-8')</code>, it will become<br>
<code>b'\xc3\xa1BA\x06\xc2\xbe\x084'</code>  differs from<br>
<code>b'\xe1BA\x06\xbe\x084'</code></p>

<p>How to deal with this?</p>