From 89fd8193743ee247349342821e011d971aa6ed0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD=20=D0=94=D0=B7=D1=8E=D0=B1=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE?= Date: Tue, 31 Aug 2021 16:34:14 +0300 Subject: [PATCH] fixed hex to char --- pym/calculate/lib/cl_template.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pym/calculate/lib/cl_template.py b/pym/calculate/lib/cl_template.py index 56cafac..d5b29db 100644 --- a/pym/calculate/lib/cl_template.py +++ b/pym/calculate/lib/cl_template.py @@ -1720,16 +1720,12 @@ class utfBin(): def _intToChar(self, x): he = hex(x)[2:] - ret = None - exec ("ret = '\\x%s'" % he) - return ret + return chr(int(he, 16)) def _hexToChar(self, he): - ret = None - exec ("ret = '\\x%s'" % he) - return ret + return chr(int(he, 16)) - def encode(self, text): + def encode(self, text): """Кодирует смешанный формат в UTF-8""" ind = 0 utf = []