Python 2 is no longer supported by the community. We recommend that you migrate Python 2 apps to Python 3. module


Utility methods related to Unicode.


Replaces 32-bit Unicode characters with surrogate pairs.

Returns a version of the string argument with all Unicode characters above 0xFFFF (those from the Supplementary Plane) replaced with the appropriate surrogate pairs. If there are no such characters, returns the same string instance.


  • s – a string, possibly of unicode type, to be converted

  • necessary. (if) –


Unicode string with surrogate pairs, or the argument unmodified.

Var denne side nyttig? Giv os en anmeldelse af den:

Send feedback om...

App Engine standard environment for Python 2