Using utf8 for jots

This commit is contained in:
aewens 2019-05-18 18:04:11 +02:00
parent 4ddbc1c915
commit 075bebc8c8
1 changed files with 3 additions and 3 deletions

View File

@ -13,10 +13,10 @@ def jots(data, readable=False):
kwargs["indent"] = 4
kwargs["separators"] = (",", ":")
try:
return dumps(data, **kwargs)
return dumps(data, encoding="utf-8", **kwargs)
except ValueError as e:
return None
# JSON decoder, converts a string to a python object
def jsto(data):
try:
@ -65,4 +65,4 @@ def b642h(base64_data, altchars=None, url=False, use_bin=False):
def ctos(_class):
pattern = regex(r"[<'>]")
cleaned = pattern.sub("", str(_class))
return cleaned.split("class ", 1)[1].split(".")[-1]
return cleaned.split("class ", 1)[1].split(".")[-1]