To set the encoding to UTF-8 in a Windows console while running a Python script, you can use the following code snippet at the beginning of your Python script:
main.py629 chars14 lines
Please note that the default cmd.exe
in Windows may not fully support UTF-8 properly. For a better experience with UTF-8 encoding in Windows, you might want to consider using a terminal emulator like Windows Terminal, which fully supports UTF-8.
gistlibby LogSnag