Mac System Sublime Text 3 Console cannot output Chinese how to handle

Source: Internet
Author: User
Tags sublime text
PC Configuration MacBook Pro (Retina, 15-inch, Mid 2015)
System version 10.13.2

I installed sublime Text3 on this machine to configure a compiled system Python3 for python3.6.
When I try to use Python3, output,
Print (' China ')
The system gives an error
Unicodeencodeerror: ' ASCII ' codec can ' t encode characters in position 0-1: Ordinal not in range (128)

Add "env" by modifying Python3.sublime-build: {"pythonioencoding": "UTF8"} to fix the problem

After the change, my sublime-build is like this.
{
"cmd": ["/usr/local/bin/python3/", "-U", "$file"],
"File_regex": "^["file \ "(...?) \ ", line ([0-9]*)",
"Selector": "Source.python",
"env": {"pythonioencoding": "UTF8"},
}

Mac System Sublime Text 3 Console cannot output Chinese how to handle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.