| 215 |
int output_conv_offset = 0; |
int output_conv_offset = 0; |
| 216 |
iconv_t input_cd = NULL; |
iconv_t input_cd = NULL; |
| 217 |
iconv_t output_cd = NULL; |
iconv_t output_cd = NULL; |
| 218 |
|
char tocode[32]; |
| 219 |
struct epoll_event ev, events[MAX_EVENTS]; |
struct epoll_event ev, events[MAX_EVENTS]; |
| 220 |
int nfds, epollfd; |
int nfds, epollfd; |
| 221 |
int stdin_read_wait = 0; |
int stdin_read_wait = 0; |
| 424 |
log_common("BBSNET connect to %s:%d from %s:%d by [%s]\n", |
log_common("BBSNET connect to %s:%d from %s:%d by [%s]\n", |
| 425 |
remote_addr, remote_port, local_addr, local_port, BBS_username); |
remote_addr, remote_port, local_addr, local_port, BBS_username); |
| 426 |
|
|
| 427 |
input_cd = iconv_open(bbsnet_conf[n].charset, stdio_charset); |
snprintf(tocode, sizeof(tocode), "%s//TRANSLIT", bbsnet_conf[n].charset); |
| 428 |
|
input_cd = iconv_open(tocode, stdio_charset); |
| 429 |
if (input_cd == (iconv_t)(-1)) |
if (input_cd == (iconv_t)(-1)) |
| 430 |
{ |
{ |
| 431 |
log_error("iconv_open(%s->%s) error: %d\n", stdio_charset, bbsnet_conf[n].charset, errno); |
log_error("iconv_open(%s->%s) error: %d\n", stdio_charset, tocode, errno); |
| 432 |
goto cleanup; |
goto cleanup; |
| 433 |
} |
} |
| 434 |
|
|
| 435 |
|
snprintf(tocode, sizeof(tocode), "%s//TRANSLIT", stdio_charset); |
| 436 |
output_cd = iconv_open(stdio_charset, bbsnet_conf[n].charset); |
output_cd = iconv_open(stdio_charset, bbsnet_conf[n].charset); |
| 437 |
if (output_cd == (iconv_t)(-1)) |
if (output_cd == (iconv_t)(-1)) |
| 438 |
{ |
{ |
| 439 |
log_error("iconv_open(%s->%s) error: %d\n", bbsnet_conf[n].charset, stdio_charset, errno); |
log_error("iconv_open(%s->%s) error: %d\n", bbsnet_conf[n].charset, tocode, errno); |
| 440 |
iconv_close(input_cd); |
iconv_close(input_cd); |
| 441 |
goto cleanup; |
goto cleanup; |
| 442 |
} |
} |