Solve the Python file created under vs2013 to other platforms (such as Linux) in Chinese garbled (or run times syntaxerror: (Unicode error) ' Utf-8 ' codec can ' t decode byte ... )

Source: Internet
Author: User

Vs2013 Create python file, in the file is not entered in Chinese, encoded as utf-8 ,

Then, after entering a few lines of Chinese, again with notepad++ to see its code as follows, in vs Run also error (run with cmd will not):

Based on the experience, this is the problem of character encoding, try to convert the python file into utf-8 , directly on the notepad++ turn utf-8 no BOM encoded format, save, open vs, there will be the following tips

Do not choose No , or you may be prompted with the following similar errors

If prompted, close it directly, otherwise,vs will save the file in ASCII format

The

Resolves python files created under vs2013, to other platforms (such as Linux) garbled in Chinese (or run times syntaxerror: (Unicode error) ' Utf-8 ' codec can ' t decode byte ... )

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.