【eclipse编码错误】SyntaxError: Non-UTF-8 code starting with '\xc4' in file

1、错误代码:

SyntaxError: Non-UTF-8 code starting with '\xc4' in file G:\eclipse\qidianBS4\mylog.py on line 7, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

错误意思:
语法错误:UTF8没有编码声明(因为含义中文字符)

2、解决办法:

1、在菜单栏选择project菜单,在弹出子菜单选择propertie
这里写图片描述

2、在properti菜单页面选择resource,然后在T**ext file encoding处**选择UTF-8,就可以解决编码问题。
这里写图片描述

猜你喜欢

转载自blog.csdn.net/weixin_42645880/article/details/81411874