1. Benjamin Peterson
  2. six


Benjamin Peterson  committed 76d9b46

document caveat of u() with non-ASCII data

  • Participants
  • Parent commits cd563f5
  • Branches default

Comments (0)

Files changed (1)

File documentation/index.rst

View file
       supports Python 3 versions greater than 3.3 thus does not need
+   .. note::
+      On Python 2, :func:`u` doesn't know what the encoding of the literal
+      is. Each byte is converted directly to the unicode codepoint of the same
+      value. Because of this, it's only safe to use :func:`u` with strings of
+      ASCII data.
 .. function:: int2byte(i)