for c in update:
try:
converted = (int(c,2))
check = chr(converted)
#Converts the inverted list back into a character
except:
overflow.append(c)
check = None
pass
encrypt.append(check)
我发生的是将字符串切换为二进制,反转二进制。例如1101变为0010,然后尝试将其切换回字符串。
当然,Windows没有无效二进制文件的映射,所以我正在为forvalids创建overflow
(列表)。我无法将值附加到该列表中。
Here is when I try a different method
不同的方法代码:
for c in update:
converted = (int(c,2))
check = chr(converted)
if check=="�":
overflow.append(c)
#Converts the inverted list back into a character
#overflow.append(c)
encrypt_list.append(check)