This question has already been answered:
- Problems with Python 2.7 encoding [closed] 3 responses
I do this:
# -*- coding: utf-8 -*- import arcpy, os, sys reload(sys) sys.setdefaultencoding('utf-8') print "++++++++++++++++++++++" print u"03_Развитие_информационных_систем".decode("utf8") print "++++++++++++++++++++++" I tried this:
print "++++++++++++++++++++++" print u"03_Развитие_информационных_систем" print "++++++++++++++++++++++" As a result, I get on the console: 03_D D°D·D²D,Ñ,D,Dµ_D,D½Ñ,D_Ñ?D¼D°Ñ+D,D_D½D½Ñ<Ñ._Ñ?D,Ñ?Ñ,DµD¼
I tried the same way:
# -*- coding: utf-8 -*- import arcpy, os, sys reload(sys) sys.setdefaultencoding('cp866') print sys.getdefaultencoding() print u"03_Развитие_информационных_систем".decode('UTF-8').encode('cp866') It also did not help.
Python 2.7 Windows 7 ENG