Force index entries to be unicode to fix problems with unicode normalization

This commit is contained in:
Armin Ronacher 2013-11-28 15:34:17 +00:00
parent 68820c94f4
commit b048ea1edf

View File

@ -1489,6 +1489,10 @@ class BuildEnvironment:
new = {} new = {}
def add_entry(word, subword, link=True, dic=new): def add_entry(word, subword, link=True, dic=new):
# Force the word to be unicode if it's a ASCII bytestring.
# This will solve problems with unicode normalization later.
# For instance the RFC role will add bytestrings at the moment
word = unicode(word)
entry = dic.get(word) entry = dic.get(word)
if not entry: if not entry:
dic[word] = entry = [[], {}] dic[word] = entry = [[], {}]