From c5d67a23389961b991fc8e530fc2215dff8b10c4 Mon Sep 17 00:00:00 2001 From: Thomas David Baker Date: Fri, 27 Sep 2024 00:12:18 -0700 Subject: [PATCH] =?UTF-8?q?Avoid=20an=20error=20when=20trying=20to=20sanit?= =?UTF-8?q?ize=20Ratonhnhak=C3=A9=EA=9E=89ton?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I'm not too sure what happens here but this at least stops things exploding. We can do more to accommodate the special colon of Ratonhnhaké꞉ton later if necessary. --- shared/text.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared/text.py b/shared/text.py index 7b714fda6..40fbdaf8c 100644 --- a/shared/text.py +++ b/shared/text.py @@ -7,6 +7,8 @@ def sanitize(s: str) -> str: s = s.encode('latin-1').decode('utf-8') except UnicodeDecodeError: pass + except UnicodeEncodeError: + pass return html.unescape(s) def unambiguous_prefixes(words: list[str]) -> list[str]: