Code:
MyTextFile.write("⚡")
Error:
UnicodeEncodeError: 'charmap' codec can't encode character '\u26a1' in position 0: character maps to <undefined>
The emoji 1.4.2 library won't work here because what I am doing is getting some text data from a website and storing it in a text file, and some of the text has emojis. I also don't want to use UTF-8 encoding because it will just turn the emojis into a bunch of text.