Skip to content
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

PR: Always use utf-8 when handling QByteArray data in ProcessWorker (Utils) #22656

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions spyder/utils/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# Standard library imports
from collections import deque
import logging
import os
import sys

# Third party imports
Expand Down Expand Up @@ -124,17 +123,8 @@ def __init__(self, parent, cmd_list, environ=None):
self._process.readyReadStandardOutput.connect(self._partial)

def _get_encoding(self):
"""Return the encoding/codepage to use."""
enco = 'utf-8'

# Currently only cp1252 is allowed?
if os.name == 'nt':
import ctypes
codepage = to_text_string(ctypes.cdll.kernel32.GetACP())
# import locale
# locale.getpreferredencoding() # Differences?
enco = 'cp' + codepage
return enco
"""Return the encoding to use."""
return 'utf-8'

def _set_environment(self, environ):
"""Set the environment on the QProcess."""
Expand Down
Loading