Your ''.join() expression is filtering, removing anything non-ASCII; you could use a conditional expression instead: return ''.join([i if ord(i) < 128 else ' ' for i in text]) This handles characters one by one and would still use one space per chara…