Serhiy Storchaka added the comment:

Default encoding on Python 3 is UTF-8. You should declare your encoding at the 
top of file if it differs from UTF-8 or ASCII (i.e. "# -*- coding: euc-jp 
-*-"). Otherwise Python will reject your file (for Shift_JIS and EUC-JP) or 
produce incorrect result (for ISO-2022-JP).

$ python3 konnichiha.Shift_JIS.py
  File "konnichiha.Shift_JIS.py", line 5
SyntaxError: Non-UTF-8 code starting with '\x82' in file 
konnichiha.Shift_JIS.py on line 5, but no encoding declared; see 
http://python.org/dev/peps/pep-0263/ for details
$ python3 konnichiha.ISO-2022-JP.py
konnichiha
B$3$s$K$A$O

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17156>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to