1
0

fix unicode in make_seed and getseed

This commit is contained in:
ThomasV
2017-08-27 09:53:22 +02:00
parent 8cb714fb70
commit 7b14516cc0
2 changed files with 5 additions and 5 deletions

View File

@@ -86,7 +86,7 @@ def is_CJK(c):
def normalize_text(seed):
# normalize
seed = unicodedata.normalize('NFKD', str(seed))
seed = unicodedata.normalize('NFKD', seed)
# lower
seed = seed.lower()
# remove accents
@@ -100,7 +100,7 @@ def normalize_text(seed):
def load_wordlist(filename):
path = os.path.join(os.path.dirname(__file__), 'wordlist', filename)
s = open(path,'r').read().strip()
s = unicodedata.normalize('NFKD', s.decode('utf8'))
s = unicodedata.normalize('NFKD', s)
lines = s.split('\n')
wordlist = []
for line in lines: