MCPcopy Index your code
hub / github.com/fabioz/PyDev.Debugger / __getfilesystemencoding

Function __getfilesystemencoding

interpreterInfo.py:73–97  ·  view source on GitHub ↗

Note: there's a copy of this method in _pydev_filesystem_encoding.py

()

Source from the content-addressed store, hash-verified

71
72
73def __getfilesystemencoding():
74 """
75 Note: there's a copy of this method in _pydev_filesystem_encoding.py
76 """
77 try:
78 ret = sys.getfilesystemencoding()
79 if not ret:
80 raise RuntimeError("Unable to get encoding.")
81 return ret
82 except:
83 try:
84 # Handle Jython
85 from java.lang import System # @UnresolvedImport
86
87 env = System.getProperty("os.name").lower()
88 if env.find("win") != -1:
89 return "ISO-8859-1" # mbcs does not work on Jython, so, use a (hopefully) suitable replacement
90 return "utf-8"
91 except:
92 pass
93
94 # Only available from 2.3 onwards.
95 if sys.platform == "win32":
96 return "mbcs"
97 return "utf-8"
98
99
100def getfilesystemencoding():

Callers 1

getfilesystemencodingFunction · 0.70

Calls 1

findMethod · 0.45

Tested by

no test coverage detected