hyugogirubato/KeyDive

'gbk' codec can't decode byte 0xad in position 7564: illegal multibyte sequence

Closed this issue · 5 comments

经过调试,执行到这里报的错
image

正常命令行没问题
image

@yiz24
If you can try to play with reading the function code because this is a text codec problem that I cannot reproduce at home. If you find a solution to overcome this codec problem, do not hesitate to submit it!

Caused by

  • using Windows with ANSI code page set to cp936
  • value of some props, likely the mobile operator name (gsm.operator.alpha), contains Chinese characters

Solvable by adding encoding='utf-8' to every subprocess.getoutput call. Although I'd prefer to use subprocess.run('adb whatever', capture_output=True).stdout and match the bytestring.
Too lazy to submit a PR, sorry.

@szescxz @yiz24
Thank you for your feedback, I have just corrected the code in the main branch.
Fix implemented in the next release.

80da61e