title: Why does this work in IDE but not in CMD Prompt?
body: <p>The code reaches out to a message board and indexes/reports the top topics. Using WING IDE, it works fine and reports no errors. However, when ran via command prompt, it will error out saying it can't properly encode a character. This is the first time I've seen this and haven't found a good resource to fix it.</p>
  
  <p>Being that it runs fine in WING, I'm unsure what else to add to the code that would prevent this issue from happening in the command prompt.</p>
  
  <pre><code>import requests
  
  from bs4 import BeautifulSoup
  
  url = raw_input("Enter the board URL: ")
  
  print "\n"
  
  #send the HTTP request
  response = requests.get(url)
  
  if response.status_code == 200:
  
      #pull the content
      html_content = response.content
  
      #send the page to BeautifulSoup
      html_doc = BeautifulSoup(html_content, "html.parser")
  
      #extract topic data
      topic_spider = html_doc.find_all("span",{"class":"subject"})
      data = []
      for topic in topic_spider:
          if topic.text!='':
              data.append(topic.text)
      topiclist = list(dict.fromkeys(data))
      topiclist.sort(reverse=False)
      for item in topiclist:
          print ('[*] ' + item)
  </code></pre>
  
  <p>WING runs this just fine with no errors. Via CMD, the following result occurs after several successful results:</p>
  
  <pre><code>[*] Parenting (successful result)
  Traceback (most recent call last):
    File "D:\xxxx\topicindexer.py", line 29, in &lt;module&gt;
      print ('[*] ' + item)
    File "C:\Python27\lib\encodings\cp437.py", line 12, in encode
      return codecs.charmap_encode(input,errors,encoding_map)
  UnicodeEncodeError: 'charmap' codec can't encode character u'\u2019' in position 31: character maps to &lt;undefined&gt;
  </code></pre>