Skip to content

Commit e5bac07

Browse files
committed
make this wrapper work on Ubuntu Linux 15.10, Go 1.5.2, opencc 0.4.3-2build1
1 parent a88d8a3 commit e5bac07

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

opencc.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,34 @@ const char *Convert(const char *input, const char *config) {
1313
strcat(configFile, config);
1414
strcat(configFile, ".json");
1515

16-
opencc_t p = opencc_new(configFile);
17-
char *out = opencc_convert(p, input);
16+
opencc_t p = opencc_open(configFile);
17+
char *out = opencc_convert_utf8(p, input, strlen(input));
1818
out[strlen(input)] = '\0';
1919

20-
opencc_delete(p);
20+
opencc_close(p);
2121

2222
return out;
2323
}
2424

2525
void Convert_free_string(char *p) {
26-
opencc_free_string(p);
26+
opencc_convert_utf8_free(p);
2727
}
2828

2929
void* Opencc_New(const char *configFile) {
30-
return opencc_new(configFile);
30+
return opencc_open(configFile);
3131
}
3232

3333
void Opencc_Delete(void *id) {
34-
opencc_delete(id);
34+
opencc_close(id);
3535
}
3636

3737
const char *Opencc_Convert(void *id, const char *input) {
38-
char *output = opencc_convert(id, input);
38+
char *output = opencc_convert_utf8(id, input, strlen(input));
3939
output[strlen(input)] = '\0';
4040
return output;
4141
}
4242

4343
void Opencc_Free_String(char *p) {
44-
opencc_free_string(p);
44+
opencc_convert_utf8_free(p);
4545
}
4646

0 commit comments

Comments
 (0)