-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The text encoding is different when fetching links #2152
Comments
You mean writing the results of |
Yes, I forgot to clarify it, with the |
I did a bit of testing. Even on Windows it uses UTF-8 as output encoding when writing to a terminal, but Python switches to some other encoding when redirecting stdout to a file ( Setting the |
Maybe a bit shorter: You can also create an environment variable by using good old CMD: SetX PYTHONIOENCODING utf-8 Adds it to the current user (HKCU in the Registry) SetX PYTHONIOENCODING utf-8 /m To set it machine-wide (HKLM) You can also use PowerShell, of course. User: [Environment]::SetEnvironmentVariable('PYTHONIOENCODING', 'utf-8', 'User') Machine: [Environment]::SetEnvironmentVariable('PYTHONIOENCODING', 'utf-8', 'Machine') Setting it system-wide (HKLM) requires administrative privileges, of course. Setting it for the user works in PowerShell, and should work with SetX as well |
I tried those but it didn't work |
Since commit e480a93 (v1.25.0), it is possible to force a specific encoding with the On Windows, Python seems to use
|
The text encoding is UCS-2 LE BOM when I fetch links, is there a special command or something I can use in the conf to make it UTF-8?
The text was updated successfully, but these errors were encountered: