Sublime Text console not showing lines with accents

后端 未结 3 1360
说谎
说谎 2021-01-04 12:20

In Sublime Text 2 and 3, the console output doesn\'t show the lines with accents on it:

\"Example\"  

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-04 12:38

    The cleaner solution is to specify the encoding as a part of the build settings

    {   
        "cmd": ["python", "-u", "$file"],
        "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
        "selector": "source.python",
        "env": {
            "PYTHONIOENCODING": "utf_8"
        },
    }
    

    This works in most cases. But in certain cases you may need to remove the -u which is basically to stop unbuffered output, as it may cause issues

    See below thread for discussion on a similar issue

    Python 2.7 build on Sublime Text 3 doesn't print the '\uFFFD' character

提交回复
热议问题