that's too much!

This commit is contained in:
2024-12-19 20:22:56 -08:00
parent 0020a609dd
commit 32cd60e92b
8443 changed files with 1446950 additions and 42 deletions

View File

@@ -0,0 +1,12 @@
from collections import UserDict
from collections.abc import Mapping
DICT_TYPES = (dict, Mapping, UserDict)
def strencode(instr, encoding="utf-8"):
try:
instr = instr.encode(encoding)
except (UnicodeDecodeError, AttributeError):
pass
return instr