-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Non-BMP character" Unicode error #16
Comments
Hi there,
This will force all tweet characters into utf-8, although you may lose some emojis and fancy icons. th3o6a1d |
cheers, i will try that and get back to you! |
Awesome... let me know if you need any help. Messing with the TwitterAPI was a fun person project a few months ago. Trying to figure out how I can use it going forward. |
i tried what you suggested above and it gave this error message, Traceback (most recent call last): this was after importing codecs.py and having the class which defined the encode function available. Is this something to do with the encode function not being relevant to the incoming text from the API? |
Whatever you're trying to code is the data type called "tuple". Data types refer to the way info is stored in memory. Other data types include "string", "integer", "boolean". The encode operation works on string data types, so you need to make sure you're extracting the tweet text, loading it into a string variable, and encoding. To learn more about data types, I recommend the Codecademy.com course on Python. It will save you a lot of time and frustration to go through the exercises.
|
thanks very much for your help, i will do! |
Hi all,
I know this is probably a really simple thing, but i'm relatively new to programming and looking for some help with an error i keep encountering.
This is the error here:
Traceback (most recent call last):
File "C:\Users\Fraser\Desktop\TwitterStream.py", line 19, in
print(item['text'] if 'text' in item else item)
File "C:\Python33\lib\idlelib\PyShell.py", line 1318, in write
return self.shell.write(s, self.tags)
UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 118-118: Non-BMP character not supported in Tk
Any idea what would help with this?
thanks!
The text was updated successfully, but these errors were encountered: