Debian Codegraph @

pypy/module/sys/interp_encoding.py

raw symbols SCIP
1 import sys
2
3 def getdefaultencoding(space):
4 """Return the current default string encoding used by the Unicode
5 implementation."""
6 return space.newtext(space.sys.defaultencoding)
7
8 base_encoding = "utf-8"
9 if sys.platform == "win32":
10 # PEP 529
11 base_error = "surrogatepass"
12 else:
13 base_error = "surrogateescape"
14
15 def _getfilesystemencoding(space):
16 """Return the filesystem encoding. Always utf-8 on PyPy."""
17 return base_encoding
18
19 def getfilesystemencoding(space):
20 """Return the encoding used to convert Unicode filenames in
21 operating system filenames.
22 """
23 if space.sys.filesystemencoding is None:
24 return space.newtext(base_encoding)
25 return space.newtext(space.sys.filesystemencoding)
26
27
28 def getfilesystemencodeerrors(space):
29 return space.newtext(base_error)