We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.


Strings are sequences that contain Unicode characters.

The items of a Unicode object are Unicode code units. A Unicode code unit is represented by a Unicode object of one item and can hold either a 16-bit or 32-bit value representing a Unicode ordinal (the maximum value for the ordinal is given in sys.maxunicode, and depends on how Python is configured at compile time). Surrogate pairs may be present in the Unicode object, and will be reported as two separate items.

The built-in functions unichr and ord convert between code units and non-negative integers representing the Unicode ordinals as defined in the Unicode Standard.

Conversion from and to other encodings are possible through the Unicode method unicode.encode and the built-in function unicode.