title: Python 3.x: Using string.maketrans() in order to create a unicode-character transformation
body: <p>I would like to write the following code:</p>
  
  <pre><code>import string
  frm = b'acdefhnoprstuw'
  to  = 'אקדיפהנופרסתאו'
  trans_table = string.maketrans(frm, to)
  hebrew_phrase = 'fear cuts deeper than swords'.translate(trans_table)
  </code></pre>
  
  <p>The above code doesn't work because the <code>to</code> parameter to <code>string.maketrans(frm, to)</code> has to be a byte sequence, not a string. The problem is that byte sequences can only contain ASCII literal characters. Therefore I cannot make a transformation which translates English strings to Hebrew strings. The reason is that <code>string.maketrans()</code> retruns a bytes object.</p>
  
  <p>Is there an elegant way to use the <code>string.maketrans()</code> and <code>translate()</code> functions (or equivalent functions that work with unicode) for my task?</p>