mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
ignore unicode characters errors
+ add methods on settings.Keys to verify key !== empty string
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
def handle_unicode(string: str):
|
||||
"""
|
||||
Try resolving unicode characters, else escape them.
|
||||
Handles Unicode errors by ignoring unicode characters
|
||||
"""
|
||||
return string.encode("utf-16", "replace").decode("utf-16")
|
||||
# try:
|
||||
# except:
|
||||
# return string.encode("unicode_escape").decode("utf-8")
|
||||
return string.encode("utf-16", "ignore").decode("utf-16")
|
||||
Reference in New Issue
Block a user