title: Python - Reading Emoji Unicode Characters
body: <p>I have a Python 2.7 program which reads iOS text messages from a SQLite database.  The text messages are unicode strings.  In the following text message:</p>
  
  <pre><code>u'that\u2019s \U0001f63b'
  </code></pre>
  
  <p>The apostrophe is represented by <code>\u2019</code>, but the emoji is represented by <code>\U0001f63b</code>.  I looked up the code point for the emoji in question, and it's <code>\uf63b</code>.  I'm not sure where the <code>0001</code> is coming from.  I know comically little about character encodings.</p>
  
  <p>When I print the text, character by character, using:</p>
  
  <pre><code>s = u'that\u2019s \U0001f63b'
  
  for c in s:
      print c.encode('unicode_escape')
  </code></pre>
  
  <p>The program produces the following output:</p>
  
  <pre><code>t
  h
  a
  t
  \u2019
  s
  
  \ud83d
  \ude3b
  </code></pre>
  
  <p>How can I correctly read these last characters in Python?  Am I using encode correctly here?  Should I just attempt to trash those <code>0001</code>s before reading it, or is there an easier, less silly way?</p>