在控制台中,当我尝试输出俄语字符时,它会给我什么???????????????
谁知道为什么?
我试着写文件——在这种情况下也是这样。
例如
f=open('tets.txt','w')
f.write('some russian text')
f.close
里面的文件是-?????????????????????????/
或者
p="some russian text"
print p
?????????????
另外,记事本不允许我用俄文字母保存文件。我给这个:
This file contains characters in Unicode format which will be lost if you save this file as an ANSI encoded text file. To keep the Unicode information, click Cancel below and then select one of the Unicode options from the Encoding drop down list. Continue?
如何调整我的系统,这样我就不会有这个问题。
下面是一个已完成的示例,请阅读注释:
如果包含非ASCII字符,则需要定义文件编码。
http://www.python.org/dev/peps/pep-0263/
尝试使用编解码器打开文件,您需要
然后
相关问题 更多 >
编程相关推荐