Message256952
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? |
|
Date |
User |
Action |
Args |
2015-12-24 03:49:49 | 王杰 | set | recipients:
+ 王杰 |
2015-12-24 03:49:49 | 王杰 | set | messageid: <1450928989.2.0.861306801503.issue25937@psf.upfronthosting.co.za> |
2015-12-24 03:49:49 | 王杰 | link | issue25937 messages |
2015-12-24 03:49:48 | 王杰 | create | |
|