From a4d09c4d2e091f355786b075784ae965efdea162 Mon Sep 17 00:00:00 2001 From: mcarans Date: Thu, 27 Jun 2024 13:52:01 +1200 Subject: [PATCH] simplify and test --- src/hdx/location/names.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hdx/location/names.py b/src/hdx/location/names.py index 26f879a..4c31a3c 100644 --- a/src/hdx/location/names.py +++ b/src/hdx/location/names.py @@ -38,6 +38,8 @@ def clean_name(name: str) -> str: chars.append(x) elif 65 <= ordch < 91: chars.append(chr(ordch + 32)) - else: + elif ordch < 32 or ordch >= 127: continue + else: + chars.append(x) return "".join(chars).strip()