157 |
#ifdef HAVE_ICONV |
#ifdef HAVE_ICONV |
158 |
size_t ibl = strlen(string), obl = len + 2; |
size_t ibl = strlen(string), obl = len + 2; |
159 |
static iconv_t iconv_h = (iconv_t) - 1; |
static iconv_t iconv_h = (iconv_t) - 1; |
160 |
char *pin = string, *pout; |
char *pin = string, *pout = s->p; |
|
#ifdef B_ENDIAN |
|
|
char ss[4096]; // FIXME: global MAX_BUF_SIZE macro need |
|
|
|
|
|
pout = ss; |
|
|
#else |
|
|
pout = s->p; |
|
|
#endif |
|
161 |
|
|
162 |
memset(pout, 0, len + 4); |
memset(pout, 0, len + 4); |
163 |
|
|
189 |
return; |
return; |
190 |
} |
} |
191 |
|
|
|
#ifdef B_ENDIAN |
|
|
swab(ss, (char *) s->p, len + 4); |
|
|
#endif |
|
|
|
|
192 |
s->p += len + 2; |
s->p += len + 2; |
193 |
|
|
194 |
#else /*HAVE_ICONV undef */ |
#else /* HAVE_ICONV undef */ |
195 |
int i = 0, j = 0; |
int i = 0, j = 0; |
196 |
|
|
197 |
len += 2; |
len += 2; |
215 |
{ |
{ |
216 |
#ifdef HAVE_ICONV |
#ifdef HAVE_ICONV |
217 |
size_t ibl = uni_len, obl = uni_len; |
size_t ibl = uni_len, obl = uni_len; |
218 |
char *pin, *pout = string; |
char *pin = s->p, *pout = string; |
219 |
static iconv_t iconv_h = (iconv_t) - 1; |
static iconv_t iconv_h = (iconv_t) - 1; |
|
#ifdef B_ENDIAN |
|
|
char ss[4096]; // FIXME: global MAX_BUF_SIZE macro need |
|
|
|
|
|
swab((char *) s->p, ss, uni_len); |
|
|
pin = ss; |
|
|
#else |
|
|
pin = s->p; |
|
|
#endif |
|
220 |
|
|
221 |
if (iconv_h == (iconv_t) - 1) |
if (iconv_h == (iconv_t) - 1) |
222 |
{ |
{ |