Closed superbobry closed 8 years ago
thanks to superbobry. I am the one report the question. we haven't fix it till now.
Apologies, I haven't had a chance to look into this, but I will at some point.
The answer is in #10: datrie
the library doesn't support alphabet ranges of size larger than 256.
@superbobry You can solve it as follows:
>>> import datrie
>>> trie = datrie.Trie(ranges=[(u'\x00', u'\xff')])
>>> key="颖礼仿古烟盒折扣"
>>> trie[key.decode('latin1')]=42
>>> trie[key.decode('latin1')]
42
>>> trie.keys()
[u'\xe9\xa2\x96\xe7\xa4\xbc\xe4\xbb\xbf\xe5\x8f\xa4\xe7\x83\x9f\xe7\x9b\x92\xe6\x8a\x98\xe6\x89\xa3']
Reported in this SO question:
The characters in a string are within the specified range:
Overflow bug somewhere?