Three settings to enable the python eclipse Development Environment (using pydev) to support Chinese Characters

Source: Internet
Author: User

(A) eclipse Window Menu editors settings:
Eclipse toolbar-> window-> preferences-> General-> editors-> text editiors-> spelling


(B) eclipse Window Menu workspace settings:
Eclipse toolbar-> window-> preferences-> General-> Workspace

 

(C) PythonSource codeAdd an additional encoding instruction to the header. Add an additional encoding instruction in the header of Your python module to let the importer parse your module using the specified encoding, as said on page 324 of version 2 of Python core programming. If the following line does not show the header of a file, the following error occurs when compiling and running a python file containing Chinese characters.

D: \ python27 \ privatelib> Python sample. py

File "sample. py", line 1
Syntaxerror: Non-ASCII character '\ xFF' in file namespaces. py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

Encoding instructions:

#-*-Encoding: UTF-8 -*-

 

From eclipse SDK 3.7.1

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.