How to use the opencc.ConvertError function in OpenCC

To help you get started, we’ve selected a few OpenCC examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jjgod / opf-cc / opencc.py View on Github external
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

OpenCC

Conversion between Traditional and Simplified Chinese

Apache-2.0
Latest version published 7 months ago

Package Health Score

78 / 100
Full package analysis