Когда я использую:
subprocess.check_output('dir', shell=True).decode('utf-8')
то получаю эту ошибку:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 1: invalid start byte
Вот вывод print(subprocess.check_output('dir', shell=True))
:
b' \x92\xae\xac \xa2 \xe3\xe1\xe2\xe0\xae\xa9\xe1\xe2\xa2\xa5 C \xad\xa5 \xa8\xac\xa5\xa5\xe2 \xac\xa5\xe2\xaa\xa8.\r\n \x91\xa5\xe0\xa8\xa9\xad\xeb\xa9 \xad\xae\xac\xa5\xe0 \xe2\xae\xac\xa0: 3858-A3CB\r\n\r\n \x91\xae\xa4\xa5\xe0\xa6\xa8\xac\xae\xa5 \xaf\xa0\xaf\xaa\xa8 C:\\Users\\User\\Desktop\\soft_and_code\\ph-dl\\kivy\\shareit\\filesharerkivy\\filesharekivy v1.3\\project\\optimazer 1\r\n\r\n27.08.2020 15:27 <DIR> .\r\n27.08.2020 15:27 <DIR> ..\r\n27.08.2020 15:27 1\xff157 cursor_info.py\r\n27.08.2020 10:41 713\xff820 output.mkv\r\n27.08.2020 10:42 715\xff370 output.mp4\r\n26.08.2020 19:54 15\xff480 passwordicon.py\r\n27.08.2020 10:38 <DIR> recordings\r\n21.08.2020 13:32 3\xff713 recording_app.zip\r\n26.08.2020 19:54 710 video_encoder.py\r\n 6 \xe4\xa0\xa9\xab\xae\xa2 1\xff450\xff250 \xa1\xa0\xa9\xe2\r\n 3 \xaf\xa0\xaf\xae\xaa 600\xff902\xff475\xff776 \xa1\xa0\xa9\xe2 \xe1\xa2\xae\xa1\xae\xa4\xad\xae\r\n'
Как мне получить результат выполнения системной команды в нормальном (в utf-8) виде?
PS OS Windows 10