-2

I'm using tweetminer to collect tweets from this site: https://github.com/kshaffer/tweetmineR

but when I run the search using twitter_search.py I get those errors:

<undefined>
'charmap' codec can't encode character '\u06cc' in position 196: character maps to <undefined>
'charmap' codec can't encode character '\U0001f43c' in position 88: character maps to <undefined>
'charmap' codec can't encode character '\u06cc' in position 210: character maps to <undefined>

They aren't exactly errors, but the search will continue. But there's a lot of them get printed on the console. How to resolve them?

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
John Sall
  • 1,027
  • 1
  • 12
  • 25

1 Answers1

2

You can try to add the parameter encoding='utf-8' each time you use open() (lines 41 and 48). Or apply .encode('utf-8') to the tweets you collect.

F Blanchet
  • 1,430
  • 3
  • 21
  • 32