title: Fixed-length encoding in Python 3
body: <p>I am currently working on an encryption/decryption program in python 3 and it works fine with strings; however, I am getting some problems converting it to use byte strings as in in UTF-8 a character can be expressed in anywhere from 1 to 4 bytes.</p>
  
  <pre><code>&gt;&gt;&gt;'\u0123'.encode('utf-8')
  b'\xc4\xa3'
  &gt;&gt;&gt;'\uffff'.encode('utf-8')
  b'\xef\xbf\xbf'
  </code></pre>
  
  <p>After some research, I found out that there is currently no encoding in python 3 that has a fixed length for every byte and has all the characters in UTF-8 - is there any module/function that I can use to get around this problem (like by attaching empty bytes so that each charter encodes to a byte string of length 4)?</p>