zjm*_*126 2 python unicode encoding escaping
我在这段代码中看到一个字符串:
data[:2] == '\xff\xfe'
Run Code Online (Sandbox Code Playgroud)
我不知道'\ xff\xfe'是什么,
所以我想逃避它,但没有成功
import cgi
print cgi.escape('\xff\xfe')#print \xff\xfe
Run Code Online (Sandbox Code Playgroud)
我怎么才能得到它.
谢谢
Mat*_*rog 11
'\ xFF'表示十六进制值为FF的字节.'\ xff\xfe'是字节顺序标记:http://en.wikipedia.org/wiki/Byte_order_mark
您也可以将其表示为两个单独的字符,但这可能不会告诉您任何有用的信息.