我正在使用Plone 3.1.1并尝试对以下字符串进行编码和解码
aa = "(。・ω・。)ノ"
bb = repr( aa ) #output: (\xef\xbd\xa1\xef\xbd\xa5\xcf\x89\xef\xbd\xa5\xef\xbd\xa1)\xef\xbe\x89
print cc.decode("utf-8") #output: (\xef\xbd\xa1\xef\xbd\xa5\xcf\x89\xef\xbd\xa5\xef\xbd\xa1)\xef\xbe\x89
我想知道为什么它不输出编码的原始字符串。但如果我把十六进制解码出来,它就会打印出原来的字符串。在
^{pr2}$基本上,我想在发送到数据库之前进行编码,在检索时解码。在
目前没有回答
相关问题 更多 >
编程相关推荐