Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
s = "Python 🐍" encoded = s.encode("utf-8") print(encoded) # bytes object print(len(s)) # character count print(len(encoded)) # byte count decoded = encoded.decode("utf-8") print(decoded == s) # True
Result
Open