Python: Unicode

By Xah Lee. Date: . Last updated: .

What is Unicode

Unicode in String

String in Python 3 is a sequence of unicode characters.

You might see string prefix with u, for example

x = u"abc"
print(x)
# abc

The u-prefix has no meaning in python 3.

the u-prefix is allowed for compatibility with python 2.

In python 2, the u-prefix changes the string type to unicode. otherwise it is byte sequence.

Python, Unicode

Python, String