string bytes into each other and

Press uft-8 encoded form   
a=’hello world’
b=a.encode(encoding=’utf-8’)
print(type(a), tyoding=’utf-8’)
print(c, type(c))

Encoded by gbk
x=a.encode(encoding=’gbk’)
print(x, type(x))
y=x.decode()
print(y, type(y))

Guess you like

Origin www.cnblogs.com/moonbaby/p/11051650.html