xxx-convert / CodeConvert

Code Convert for Python 2.x for Humans™
https://pypi.org/project/CodeConvert/
0 stars 1 forks source link

®(\xae)、 ¥(\xa5)判断编码类型错误 #3

Closed Brightcells closed 9 years ago

Brightcells commented 9 years ago

1、 错误示例

In [3]: u'Mercury Leafer®'
Out[3]: u'Mercury Leafer\xae'
ipdb> kw
u'\xa5\u575a\u6301\xa5\u8389$'
ipdb> print kw
¥坚持¥莉$

2、 ¥/¥ 全角半角区别

In [14]: unicode('¥', 'utf-8')
Out[14]: u'\uffe5'

Ref:http://unicode-table.com/en/#FFE5

In [15]: unicode('¥', 'utf-8')
Out[15]: u'\xa5'

Ref:http://unicode-table.com/en/#00A5

Brightcells commented 9 years ago

https://github.com/Brightcells/CodeConvert/commit/dad5847d0cb595aed9128cbdece8ceab198c855b