path.isfile(path) else None def encode(s): # print("--") # print(chardet.detect(s)) return unicode(s).encode("UTF-8") if s else "" def decode(s): if not s: return "" cd = {} try: cd = chardet.detect(s) except Exception: # print(traceback.format_exc()) pass encoding...