title: What is a unicode string?
body: <p>What exactly is a unicode string? </p>
  
  <p>What's the difference between a regular string and unicode string?</p>
  
  <p>What is utf-8?</p>
  
  <p>I'm trying to learn Python right now, and I keep hearing this buzzword. What does the code below do?</p>
  
  <p><strong>i18n Strings (Unicode)</strong></p>
  
  <pre><code>&gt; ustring = u'A unicode \u018e string \xf1'
  &gt; ustring
  u'A unicode \u018e string \xf1'
  
  ## (ustring from above contains a unicode string)
  &gt; s = ustring.encode('utf-8')
  &gt; s
  'A unicode \xc6\x8e string \xc3\xb1'  ## bytes of utf-8 encoding
  &gt; t = unicode(s, 'utf-8')             ## Convert bytes back to a unicode string
  &gt; t == ustring                      ## It's the same as the original, yay!
  True
  </code></pre>
  
  <p><strong>Files Unicode</strong></p>
  
  <pre><code>import codecs
  
  f = codecs.open('foo.txt', 'rU', 'utf-8')
  for line in f:
  # here line is a *unicode* string
  </code></pre>