Lynnesbian / mstdn-ebooks

NO LONGER BEING UPDATED, NOT GUARANTEED TO WORK AT ALL
Mozilla Public License 2.0
35 stars 27 forks source link

Error when decoding Emoji #13

Closed lfuelling closed 5 years ago

lfuelling commented 5 years ago

I got an error when running gen.py with --simulate. Apparently the script fails when trying to decode the "zany-face"-Emoji.

╭─lerk@comm ~/mstdn-ebooks  ‹master*› 
╰─$ python3 ./gen.py --simulate
Traceback (most recent call last):
  File "./gen.py", line 39, in <module>
    print(toot['toot'])
UnicodeEncodeError: 'ascii' codec can't encode character '\U0001f92a' in position 100: ordinal not in range(128)

Can I ignore invalid characters somehow?

Lynnesbian commented 5 years ago

I'm having some trouble reproducing this: Python 2 and 3 print emoji fine

I do understand what the error is, though. I'll update the script so that if it fails to print the first time, it strips out any non-Unicode characters and tries again.