161 |
#ifdef HAVE_ICONV |
#ifdef HAVE_ICONV |
162 |
size_t ibl = strlen(string), obl = len + 2; |
size_t ibl = strlen(string), obl = len + 2; |
163 |
static iconv_t iconv_h = (iconv_t) - 1; |
static iconv_t iconv_h = (iconv_t) - 1; |
164 |
char *pin = string, *pout = s->p; |
char *pin = string, *pout = (char *)s->p; |
165 |
|
|
166 |
memset(pout, 0, len + 4); |
memset(pout, 0, len + 4); |
167 |
|
|
176 |
g_codepage, WINDOWS_CODEPAGE, (int) iconv_h); |
g_codepage, WINDOWS_CODEPAGE, (int) iconv_h); |
177 |
|
|
178 |
g_iconv_works = False; |
g_iconv_works = False; |
179 |
return (rdp_out_unistr(s, string, len)); |
rdp_out_unistr(s, string, len); |
180 |
|
return; |
181 |
} |
} |
182 |
if (iconv(iconv_h, (ICONV_CONST char **) &pin, &i, &pout, &o) == |
if (iconv(iconv_h, (ICONV_CONST char **) &pin, &i, &pout, &o) == |
183 |
(size_t) - 1) |
(size_t) - 1) |
187 |
warning("rdp_out_unistr: iconv(1) fail, errno %d\n", errno); |
warning("rdp_out_unistr: iconv(1) fail, errno %d\n", errno); |
188 |
|
|
189 |
g_iconv_works = False; |
g_iconv_works = False; |
190 |
return (rdp_out_unistr(s, string, len)); |
rdp_out_unistr(s, string, len); |
191 |
|
return; |
192 |
} |
} |
193 |
pin = string; |
pin = string; |
194 |
pout = (char *) s->p; |
pout = (char *) s->p; |
201 |
warning("rdp_out_unistr: iconv(2) fail, errno %d\n", errno); |
warning("rdp_out_unistr: iconv(2) fail, errno %d\n", errno); |
202 |
|
|
203 |
g_iconv_works = False; |
g_iconv_works = False; |
204 |
return (rdp_out_unistr(s, string, len)); |
rdp_out_unistr(s, string, len); |
205 |
|
return; |
206 |
} |
} |
207 |
|
|
208 |
s->p += len + 2; |
s->p += len + 2; |
234 |
{ |
{ |
235 |
#ifdef HAVE_ICONV |
#ifdef HAVE_ICONV |
236 |
size_t ibl = uni_len, obl = uni_len; |
size_t ibl = uni_len, obl = uni_len; |
237 |
char *pin = s->p, *pout = string; |
char *pin = (char *)s->p, *pout = string; |
238 |
static iconv_t iconv_h = (iconv_t) - 1; |
static iconv_t iconv_h = (iconv_t) - 1; |
239 |
|
|
240 |
if (g_iconv_works) |
if (g_iconv_works) |