Display Non-UTF-8 output

Posted 金庆

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Display Non-UTF-8 output相关的知识,希望对你有一定的参考价值。

Display Non-UTF-8 output

(Jin Qing’s Column, Oct. 27, 2021)

Cargo build output Non-UTF-8. Use python to decode it as gbk and print.

C:\\Users\\jinqing01>python
>>> s = b'Non-UTF-8 output:   \\xd5\\xfd\\xd4\\xda\\xb4\\xb4\\xbd\\xa8\\xbf\\xe2 E:\\\\gitlab\\\\myproj\\\\target\\\\debug\\\\deps\\\\pyext.dll.lib \\xba\\xcd\\xb6\\xd4\\xcf\\xf3 E:\\\\gitlab\\\\myproj\\\\target\\\\debug\\\\deps\\\\pyext.dll.exp\\r\\npyext.2rtvxajnfydf6uo2.rcgu.o : error LNK2019: \\xce\\xde\\xb7\\xa8\\xbd\\xe2\\xce\\xf6\\xb5\\xc4\\xcd\\xe2\\xb2\\xbf\\xb7\\xfb\\xba\\xc5 __imp_PyUnicode_AsUTF8\\xa3\\xac\\xba\\xaf\\xca\\xfd _ZN116_$LT$pyext..script..pyext..py_object_proxy..PyNonTxnStates$u20$as$u20$pyext..object..state..NonTxnStates$GT$14to_mysql_value17h5dbfad19064f6106E \\xd6\\xd0\\xd2\\xfd\\xd3\\xc3\\xc1\\xcb\\xb8\\xc3\\xb7\\xfb\\xba\\xc5\\r\\npyext.3i2r75wtstbttq2v.rcgu.o : error LNK2001: \\xce\\xde\\xb7\\xa8\\xbd\\xe2\\xce\\xf6\\xb5\\xc4\\xcd\\xe2\\xb2\\xbf\\xb7\\xfb\\xba\\xc5 __imp_PyUnicode_AsUTF8\\r\\nlibpyutil-98f7dde2ceee0f61.rlib(pyutil-98f7dde2ceee0f61.2r21sryt0zfxlscx.rcgu.o) : error LNK2001: \\xce\\xde\\xb7\\xa8\\xbd\\xe2\\xce\\xf6\\xb5\\xc4\\xcd\\xe2\\xb2\\xbf\\xb7\\xfb\\xba\\xc5 __imp_PyUnicode_AsUTF8\\r\\nE:\\\\gitlab\\\\myproj\\\\target\\\\debug\\\\deps\\\\pyext.dll : fatal error LNK1120: 1 \\xb8\\xf6\\xce\\xde\\xb7\\xa8\\xbd\\xe2\\xce\\xf6\\xb5\\xc4\\xcd\\xe2\\xb2\\xbf\\xc3\\xfc\\xc1\\xee\\r\\n'
>>> s.decode('gbk')
'Non-UTF-8 output:   正在创建库 E:\\\\gitlab\\\\myproj\\\\target\\\\debug\\\\deps\\\\pyext.dll.lib 和对象 E:\\\\gitlab\\\\myproj\\\\target\\\\debug\\\\deps\\\\pyext.dll.exp\\r\\npyext.2rtvxajnfydf6uo2.rcgu.o : error LNK2019: 无法解析的外部 符号 __imp_PyUnicode_AsUTF8,函数 _ZN116_$LT$pyext..script..pyext..py_object_proxy..PyNonTxnStates$u20$as$u20$pyext..object..state..NonTxnStates$GT$14to_mysql_value17h5dbfad19064f6106E 中引用了该符号\\r\\npyext.3i2r75wtstbttq2v.rcgu.o : error LNK2001: 无法解析的外部符号 __imp_PyUnicode_AsUTF8\\r\\nlibpyutil-98f7dde2ceee0f61.rlib(pyutil-98f7dde2ceee0f61.2r21sryt0zfxlscx.rcgu.o) : error LNK2001: 无法解析的外部符号 __imp_PyUnicode_AsUTF8\\r\\nE:\\\\gitlab\\\\myproj\\\\target\\\\debug\\\\deps\\\\pyext.dll : fatal error LNK1120: 1 个无法解析的外部命令\\r\\n'
>>>

以上是关于Display Non-UTF-8 output的主要内容,如果未能解决你的问题,请参考以下文章

python运行错误------Non-UTF-8 code

Non-UTF-8 code starting with 'xff'解决,记录

解决Python代码编码问题 SyntaxError: Non-UTF-8 code starting with 'xc1'

SyntaxError: Non-UTF-8 code starting with 'xbb' in file D:流畅学pythonex32.py on line 1, but no

WPF Datagrid contains ComboBox while display textblock when display and combobox in editing mode(示例代

解决multivariate_normal中:output parameter (typecode ‘d‘) according to the casting rule ‘‘same_kind‘‘(代