I use a python library that prints out a Unicode character to windows console. If I call a function on the library that prints out Unicode character, it will throw an exception 'charmap' codec can't encode characters
.
So this is what I tried to solve that error:
Call "chcp 65001" windows console command from python using os.system("chcp 65001")
before calling the library function.
I know there are questions similar to this and that is why I tried the above solution. It successfully calls the command on the console and tells me that it activated the code page.
However, the exception showed up again.
If I try to run the program again without closing the previous console, the program executes successfully without any exception. Which means the above console command takes effect after the first try.
My question is: is there a way to launch windows console by pre-activating Unicode support so that I don't have to call the program twice.