title: utf-8 encoding and getting a string slice
body: <p>I'm parsing a twitter and there's a need to encode the text since in case there is no encoding, there is an exception. But when I use 'utf-8' it doesn't only add b symbol to the console output, but also makes it impossible to access parts of the string. What can I do to fix it or what other encoding should I try?</p>
  
  <p>Here is an example of what happens.</p>
  
  <pre><code>&gt;&gt;&gt; a="newyear"
  &gt;&gt;&gt; b=a.encode("utf-8")
  &gt;&gt;&gt; a
  'newyear'
  &gt;&gt;&gt; b
  b'newyear'
  &gt;&gt;&gt; a[0]
  'n'
  &gt;&gt;&gt; b[0]
  110
  </code></pre>
  
  <p>My parser code is the following:</p>
  
  <pre><code>tweets=soup.findAll("p", {"class":"TweetTextSize"})  
  
  n=0
  for tweet in tweets:  
  
  
      n+=1;
      print(n)
      a=tweet.text 
      b=a.encode("utf-8")   
      print(b)   #works fine, but returns bytestring, extra b character,
      #and I can't get b[0]
      print(b.decode("utf-8")) #doesn't work - 
      #UnicodeEncodeError: ‘charmap’ code can’t encode character '\u2026'
  
      #uncommented try section works, but it replaces "bad" tweets with ops, 
      #which I'd rather avoid
      # try:
          # print(tweet.text)
      # except:
          # print("OPS")
  </code></pre>
  
  <p>So I can handle the exception with try, but I was wondering if there is some other way.</p>
  
  <p>I'm using Python 3.</p>