integer causing normalization issue in MQTT #1102
Some checks are pending
Code checks / check-url-paths (push) Waiting to run
docker / docker_dev (push) Waiting to run
Deploy MkDocs / deploy (push) Waiting to run

This commit is contained in:
jokob-sk
2025-06-26 07:25:10 +10:00
parent 94edcee382
commit e8e48a2cc4

View File

@@ -495,6 +495,8 @@ def sanitize_SQL_input(val):
# Function to normalize the string and remove diacritics
def normalize_string(text):
# Normalize the text to 'NFD' to separate base characters and diacritics
if not isinstance(text, str):
text = str(text)
normalized_text = unicodedata.normalize('NFD', text)
# Filter out diacritics and unwanted characters
return ''.join(c for c in normalized_text if unicodedata.category(c) != 'Mn')