interpreterInfo.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:specto 作者: mrknow 项目源码 文件源码
def __getfilesystemencoding():
    '''
    Note: there's a copy of this method in _pydev_filesystem_encoding.py
    '''
    try:
        ret = sys.getfilesystemencoding()
        if not ret:
            raise RuntimeError('Unable to get encoding.')
        return ret
    except:
        try:
            # Handle Jython
            from java.lang import System  # @UnresolvedImport
            env = System.getProperty("os.name").lower()
            if env.find('win') != -1:
                return 'ISO-8859-1'  # mbcs does not work on Jython, so, use a (hopefully) suitable replacement
            return 'utf-8'
        except:
            pass

        # Only available from 2.3 onwards.
        if sys.platform == 'win32':
            return 'mbcs'
        return 'utf-8'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号