[New-bugs-announce] [issue25937] DIfference between utf8 and utf-8 when i define python source code encoding.
王杰
report at bugs.python.org
Wed Dec 23 22:49:49 EST 2015
New submission from 王杰:
I use CentOS 7.0 and change LANG=gbk.
I has a file "gbk-utf-8.py" and it's encoding is GBK.
# -*- coding:utf-8 -*-
import chardet
if __name__ == '__main__':
s = '中文'
print s, chardet.detect(s)
I execute it and everything is ok. However it raise "SyntaxError" (as I expected) after I change "encoding:utf-8" to "encoding:utf8".
File "gbk-utf8.py", line 2
SyntaxError: 'utf8' codec can't decode byte 0xd6 in position 0: invalid continuation byte
Is this ok? Or where I wrong?
----------
messages: 256952
nosy: 王杰
priority: normal
severity: normal
status: open
title: DIfference between utf8 and utf-8 when i define python source code encoding.
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25937>
_______________________________________
More information about the New-bugs-announce
mailing list