title: converting tweets to string in Python
body: <p>I'm using tweepy to collect random tweets,
  and I want to filter out non-alphanumeric tweets.</p>
  
  <p>But in order to do the checking, I first need to convert the tweets to string.
  For example,</p>
  
  <pre><code>from tweepy import StreamListener
  ....
  
  class sListener(StreamListener):
         def on_status(self,status):
              ....
              text = str(status.text)
              if not isAlphanumeric(text):
                  ......
  </code></pre>
  
  <p>However, using str() to convert the tweet to string itself results in an error if the tweet is non-ascii with the following message:</p>
  
  <pre><code>UnicodeEncodeError: 'ascii' codec can't encode character
  </code></pre>
  
  <p>So I'm stuck in a loop where I need to convert to string to filter non-ascii, but I can't convert to string because of non-ascii....</p>
  
  <p>I don't even know what data type tweets are...</p>
  
  <p>Could anyone please help me out?</p>