Unicode and Encoding

Working with Unicode in Python

Interview Relevant: Internationalization

Unicode

Python 3 strings are Unicode by default.

Code Examples

Encoding and decoding.

python
1s = "Café"
2b = s.encode("utf-8")  # bytes
3s2 = b.decode("utf-8") # string

AI Tutor

Ask about the topic

Sign in Required

Please sign in to use the AI tutor

Sign In