blob: 2246ca67db5e74042b07e498223633fd8da36fd5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#ifndef _WIN32
#include <stdlib.h>
#include <iconv.h>
iconv_t hs_iconv_open(const char* tocode,
const char* fromcode)
{
return iconv_open(tocode, fromcode);
}
size_t hs_iconv(iconv_t cd,
const char* * inbuf, size_t * inbytesleft,
char* * outbuf, size_t * outbytesleft)
{
// (void*) cast avoids a warning. Some iconvs use (const
// char**inbuf), other use (char **inbuf).
return iconv(cd, (void*)inbuf, inbytesleft, outbuf, outbytesleft);
}
int hs_iconv_close(iconv_t cd) {
return iconv_close(cd);
}
#endif
|