| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/lqlstudio/netkiller.github.io/master/python/string.html#str.fun | [Back] [Original] |
>>> b = str.encode(y)
>>> type(b) >>> b bHello World!
To alter from bytes to str, capitalize on bytes.decode().
>>> z = bHello World!
>>> y = Hello World!
>>> type(z)
>>> type(y)
To alter from str to bytes, capitalize on str.encode().
>>> a = bytes.decode(z)
>>> type(a)
>>> a
Hello World!
# to utf-8
'BG7NYT'.encode('utf-8')
# to utf-16
'BG7NYT'.encode('utf-16')
| Web Proxy Viewer | New URL | Original Page |