Search code examples
pythonwindowsmingwtermuxcharmap

how to solved charmap' codec can't encode character '\u300b?


I'm trying to start a script, but I have run in to a problem. [ERROR] 'charmap' codec can't encode character '\u300b' in position 11: character maps to


Solution

  • Your code is printing something that is unreadable for the machine. Try changing the output encoding to "utf-8" or just use code below at the very first lines of your code:

    import sys
    sys.stdin.reconfigure(encoding='utf-8')
    sys.stdout.reconfigure(encoding='utf-8')