73 const char * inbuf = src.c_str();
74 char outbuf[1024], *outbufptr = outbuf;
75 size_t inbytesleft = src.size(), outbytesleft = 1024;
76#if (defined __linux__ || defined __APPLE__)
77 typedef char ** iconv_inbuf_t;
79 typedef const char ** iconv_inbuf_t;
83 while ((success = iconv(cd.cd, (iconv_inbuf_t)&inbuf, &inbytesleft,
84 &outbufptr, &outbytesleft)) >= 0
86 if (outbufptr - outbuf >= 512)
88 ret += std::string(outbuf, outbufptr);
93 ret += std::string(outbuf, outbufptr);