/usr/bin/python #-*- coding: UTF-8-*-
PyCharm新建文件时可以在模板中添加编码字符集为utf-8,新建文件可自动添加了
/usr/bin/env python3 #encoding=utf-8 import codecs "这个模块用于读取widons下的文本文件,windows下的文本文件会存为\ (ANSI, utf-8, unicode, unicode big endian)4种编码格式\ 这个模块就用于读取这4种格式的文本" name="WinTxtReader" version="1.0" author="vily" email="vily313@126.com" def r...
string strTempUTF8 = GB2312ToUTF8(strTemp); WritePrivateProfileStringA("Path", "Path1", strTempUTF8.c_str(), W2A(m_strIniFileFullPath));
pycharm默认添加utf-8编码 见下图可以添加或者去掉默认编码,路径:File—settings—Editor—FileandCodeTemplates—PythonScript添加# --coding:utf-8-- 或者# *coding:utf-8* 如果想去掉在这里删除掉就可以。 学习笔记之Python的环境搭建 startup • 7、修改新建文件文件头File–settings–Editor—CodeStyle —File...