Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def convert(self, text):
retv_c = self.libopencc.opencc_convert_utf8(self.od, text, len(text))
if retv_c == -1:
self.__perror('OpenCC error:')
raise ConvertError()
retv_c = cast(retv_c, c_char_p)
str_buffer = retv_c.value
self.libopencc.opencc_convert_utf8_free(retv_c);
return str_buffer