Note: there's a copy of this method in _pydev_filesystem_encoding.py
()
| 71 | |
| 72 | |
| 73 | def __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 | |
| 100 | def getfilesystemencoding(): |
no test coverage detected