title: Convert bytes to ascii and back save in Python?
body: <p>I'm Using python 3.5</p>
  
  <p>I have a couple of byte strings representing text that is encoded in various codecs so: <code>b'mybytesstring'</code> , now some are <code>Utf8</code> encoded other are <code>latin1</code> and so on. What I want to in the following order is:</p>
  
  <ul>
  <li>transform the bytes string into an ascii like string.</li>
  <li>transform the ascii like string back to a bytes string.</li>
  <li>decode the bytes string with correct codec.</li>
  </ul>
  
  <p>The problem is that I have to move the bytes string into something that does not accept bytes objects so I'm looking for a solution that lets me do <code>bytes -&gt; ascii -&gt; bytes</code> safely.</p>