mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
MQTT handling diacritics #813
Some checks are pending
docker / docker_dev (push) Waiting to run
Some checks are pending
docker / docker_dev (push) Waiting to run
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
import io
|
||||
import sys
|
||||
import datetime
|
||||
# from datetime import strptime
|
||||
import os
|
||||
import re
|
||||
import unicodedata
|
||||
import subprocess
|
||||
import pytz
|
||||
from pytz import timezone
|
||||
@@ -812,6 +812,14 @@ def sanitize_SQL_input(val):
|
||||
return ''
|
||||
return val.replace("'", "_")
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Function to normalize the string and remove diacritics
|
||||
def normalize_string(text):
|
||||
# Normalize the text to 'NFD' to separate base characters and diacritics
|
||||
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')
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
def generate_mac_links (html, deviceUrl):
|
||||
|
||||
Reference in New Issue
Block a user