Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100731 > unrolled thread

unicodedata with chr() not the same between python 3.4 and 3.5

Started byVincent Davis <vincent@vincentdavis.net>
First post2015-12-22 09:27 -0600
Last post2015-12-22 09:27 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  unicodedata with chr() not the same between python 3.4 and 3.5 Vincent Davis <vincent@vincentdavis.net> - 2015-12-22 09:27 -0600

#100731 — unicodedata with chr() not the same between python 3.4 and 3.5

FromVincent Davis <vincent@vincentdavis.net>
Date2015-12-22 09:27 -0600
Subjectunicodedata with chr() not the same between python 3.4 and 3.5
Message-ID<mailman.59.1450798048.2237.python-list@python.org>
​I was expecting the code below to be the same between python3.4 and 3.5. I
need a mapping between the integers and unicode that is consistant between
3.4 and 3.5

>>>
import unicodedata
>>>
u = ''.join(chr(i) for i in range(65536) if (unicodedata.category(chr(i))
in ('Lu', 'Ll')))[945:965]
>>> u
'ԡԢԣԤԥԦԧԨԩԪԫԬԭԮԯԱԲԳԴԵ'

Python 3.4
>>>
import unicodedata
>>>
u = ''.join(chr(i) for i in range(65536) if (unicodedata.category(chr(i))
in ('Lu', 'Ll')))[945:965]
>>> u
'ԢԣԤԥԦԧԱԲԳԴԵԶԷԸԹԺԻԼԽԾ'

As you can see they are not the same
​.​


'ԡԢԣԤԥԦԧԨԩԪԫԬԭԮԯԱԲԳԴԵ'
'ԢԣԤԥԦԧԱԲԳԴԵԶԷԸԹԺԻԼԽԾ'




Vincent Davis
720-301-3003

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web