Performing safe encoding

This commit is contained in:
ZhymabekRoman 2024-02-02 06:02:53 +06:00
parent b0822caf1d
commit 340bfaec72

View file

@ -36,7 +36,7 @@ class StringAsignmentMix:
def encode(self, encoding: str):
self.__render_string()
return self.string.encode(encoding)
return self.string.encode(encoding, "surrogatepass")
def insert(self, key: int, value):
self.string_list.insert(key, value)
@ -363,7 +363,7 @@ class RLStringHelper:
self.quote_replaces.append(html_quote)
if not self.templates and not self.replaces and not self.quote_replaces:
logger.debug("No templates, no replaces, no quote_replaces")
logger.trace("No templates, no replaces, no quote_replaces")
return str(self.string)
updated_text, string_pos_matrix, utf_16_bang_list = self._render_templates(updated_text, string_pos_matrix, utf_16_bang_list)