Serhiy Storchaka added the comment: An interactive Python console ignores a coding cookie line too.
$ cat test.py # -*- coding: koi8-r -*- print repr('йцук'), 'йцук', repr(u'йцук'), u'йцук' $ LC_ALL=ru_RU.cp1251 LANG=ru_RU.cp1251 ./python test.py '\xe9\xf6\xf3\xea' йцук u'\u0418\u0416\u0421\u0419' ИЖСЙ $ LC_ALL=ru_RU.cp1251 LANG=ru_RU.cp1251 ./python Python 2.7.4+ (2.7:0f31f38e8a17+, Apr 13 2013, 21:06:36) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> # -*- coding: koi8-r -*- ... print repr('йцук'), 'йцук', repr(u'йцук'), u'йцук' '\xe9\xf6\xf3\xea' йцук u'\u0439\u0446\u0443\u043a' йцук ('\xe9\xf6\xf3\xea' is 'йцук' in cp1251 and 'ИЖСЙ' in koi8-r) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15809> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com