eclipse 编辑python windows平台乱码解决方法

来源:互联网 发布:小说编辑软件 编辑:程序博客网 时间:2024/06/06 07:37
首先要确保eclipse编辑器环境的编码为utf8,这个是大前提;其次如果py文件中含有中文字符的话,需要在py文件
中对编码进行声明。
1. 修改eclipse编辑器编码
a) window->preferences->general->editors->text editors->spelling->encoding->UTF-8
b) window->preferences->workspace->text file encoding->UTF-8
c) 打开eclipse安装目录->eclipse.ini,末行加上”-Dfile.encoding=UTF-8”
2. 修改Python文件编码声明

在py文件首行加上#coding=utf-8,一定要在首行才可以





0 0