delta encoding of upper/lower/title makes a glorious return (#12736)

This commit is contained in:
Benjamin Peterson 2012-01-15 21:19:20 -05:00
parent da05f454e3
commit ad9c569825
3 changed files with 1448 additions and 3544 deletions

View file

@ -443,6 +443,13 @@ def makeunicodetype(unicode, trace):
if sc is None:
if upper == lower == title:
upper = lower = title = 0
else:
upper = upper - char
lower = lower - char
title = title - char
assert (abs(upper) <= 2147483647 and
abs(lower) <= 2147483647 and
abs(title) <= 2147483647)
else:
# This happens either when some character maps to more than one
# character in uppercase, lowercase, or titlecase or the