more libraries

This commit is contained in:
2024-09-28 22:58:22 -07:00
parent 1973934e95
commit b6e3e24aec
1099 changed files with 326677 additions and 208 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