title: Python How to convert 8-bit ASCII string to 16-Bit Unicode
body: <p>Although Python 3.x solved the problem that uppercase and lowercase for some locales (for example tr_TR.utf8) Python 2.x branch lacks this. Several workaround for this issuse like <a href="https://github.com/emre/unicode_tr/" rel="nofollow">https://github.com/emre/unicode_tr/</a> but did not like this kind of a solution.</p>
  
  <p>So I am implementing a new upper/lower/capitalize/title methods for monkey-patching unicode class with 
  <a href="https://docs.python.org/2/library/string.html#string.maketrans" rel="nofollow">string.maketrans</a> method.</p>
  
  <p>The problem with maketrans is the lenghts of two strings must have same lenght.
  The nearest solution came to my mind is "How can I convert 1 Byte char to 2 bytes?"</p>
  
  <hr>
  
  <p><strong>Note:</strong> <code>translate</code> method does work only ascii encoding, when I pass <code>u'İ'</code> (1 byte length \u0130) as arguments to <code>translate</code> gives ascii encoding error.</p>
  
  <pre><code>from string import maketrans
  
  import unicodedata
  c1 = unicodedata.normalize('NFKD',u'i').encode('utf-8')
  c2 = unicodedata.normalize('NFKD',u'İ').encode('utf-8')
  c1,len(c1)
  ('\xc4\xb1', 2)
  
  # c2,len(c2)
  # ('I', 1)
  'istanbul'.translate( maketrans(c1,c2))
  ValueError: maketrans arguments must have same length
  </code></pre>