| 235 | } |
| 236 | |
| 237 | size_t opencc_convert_utf8_to_buffer(opencc_t opencc, const char* input, |
| 238 | size_t length, char* output) { |
| 239 | try { |
| 240 | SimpleConverter* instance = reinterpret_cast<SimpleConverter*>(opencc); |
| 241 | return instance->Convert(input, length, output); |
| 242 | } catch (std::runtime_error& ex) { |
| 243 | cError = ex.what(); |
| 244 | return static_cast<size_t>(-1); |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | char* opencc_convert_utf8(opencc_t opencc, const char* input, size_t length) { |
| 249 | try { |