|
@@ -14,9 +14,11 @@ public:
|
|
|
int convert(char *input, char *output, size_t outbufsize) {
|
|
|
size_t inbufsize = strlen(input);
|
|
|
size_t orig_size = outbufsize;
|
|
|
- memset(output, 0, outbufsize);
|
|
|
-
|
|
|
- return iconv(ic, &input, &inbufsize, &output, &outbufsize);
|
|
|
+ // memset(output, 0, outbufsize);
|
|
|
+ // https://www.gnu.org/savannah-checkouts/gnu/libiconv/documentation/libiconv-1.15/iconv.3.html
|
|
|
+ int r = iconv(ic, &input, &inbufsize, &output, &outbufsize);
|
|
|
+ *output = 0;
|
|
|
+ return r;
|
|
|
}
|
|
|
};
|
|
|
|