You are viewing an older version (9.3.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.3.0 / IPython / utils / openpy / source_to_unicode

function

IPython.utils.openpy:source_to_unicode

source: /IPython/utils/openpy.py :17

Signature

def   source_to_unicode ( txt errors = replace skip_encoding_cookie = True )

Summary

Converts a bytes string with python source code to unicode.

Extended Summary

Unicode strings are passed through unchanged. Byte strings are checked for the python source file encoding cookie to determine encoding. txt can be either a bytes buffer or a string containing the source code.

Aliases

  • IPython.utils.openpy.source_to_unicode