import redis import chardet r.set("name","我是在Py3保存的中文字符串") ret = r.get("name")#(一个汉字三个字节) print(ret,type(ret)) print(chardet.detect(ret))#chardet.detect检测的字符串越长越准确,越短越不准确。 print(ret.decode("utf-8"))
转载于:https://www.cnblogs.com/ssyfj/p/8605865.html
import redis import chardet r.set("name","我是在Py3保存的中文字符串") ret = r.get("name")#(一个汉字三个字节) print(ret,type(ret)) print(chardet.detect(ret))#chardet.detect检测的字符串越长越准确,越短越不准确。 print(ret.decode("utf-8"))
转载于:https://www.cnblogs.com/ssyfj/p/8605865.html