代码之家  ›  专栏  ›  技术社区  ›  Yagnesh

UnicodeDecodeError:“utf-8”编解码器无法解码位置617中的字节0x96:无效的起始字节

  •  0
  • Yagnesh  · 技术社区  · 2 年前
    File "d:\visual studio\python\sub.py", line 3, in <module>
        command_output = subprocess.run(["netsh", "wlan", "show", "profile"], capture_output = True).stdout.decode()
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 617: invalid start byte
    

    这在没有decode()的情况下运行,但忽略了和\r\n decode()抛出unicode错误有人知道吗?

    0 回复  |  直到 2 年前