| 1120 |
if (in_bytes == 0) |
if (in_bytes == 0) |
| 1121 |
{ |
{ |
| 1122 |
in_bytes = (size_t)(*p_buf_len - *p_buf_offset); |
in_bytes = (size_t)(*p_buf_len - *p_buf_offset); |
| 1123 |
|
#ifdef _DEBUG |
| 1124 |
|
log_error("Reset in_bytes from 0 to %d\n", in_bytes); |
| 1125 |
|
#endif |
| 1126 |
} |
} |
| 1127 |
|
|
| 1128 |
*out_buf = *in_buf; |
#ifdef _DEBUG |
| 1129 |
in_buf++; |
log_error("iconv(in_bytes=%d, out_bytes=%d) error: EILSEQ, in_buf[0]=%d\n", |
| 1130 |
out_buf++; |
in_bytes, out_bytes, in_buf[0]); |
| 1131 |
in_bytes--; |
#endif |
| 1132 |
out_bytes--; |
skip_current = 1; |
|
|
|
|
(*p_buf_offset)++; |
|
|
(*p_conv_len)++; |
|
|
|
|
|
continue; |
|
| 1133 |
} |
} |
| 1134 |
else // something strange |
else // something strange |
| 1135 |
{ |
{ |
| 1136 |
#ifdef _DEBUG |
#ifdef _DEBUG |
| 1137 |
log_error("*p_buf_offset += %d, *p_conv_len = %d, in_bytes=%d, out_bytes=%d, in_buf[0]=%d\n", |
log_error("iconv(in_bytes=%d, out_bytes=%d) error: %d, in_buf[0]=%d\n", |
| 1138 |
(int)(in_buf - p_buf), (int)(conv_size - out_bytes), in_bytes, out_bytes, in_buf[0]); |
in_bytes, out_bytes, errno, in_buf[0]); |
| 1139 |
#endif |
#endif |
| 1140 |
|
*p_buf_offset = (int)(in_buf - p_buf); |
|
*p_buf_offset += (int)(in_buf - p_buf); |
|
| 1141 |
*p_conv_len = (int)(conv_size - out_bytes); |
*p_conv_len = (int)(conv_size - out_bytes); |
| 1142 |
skip_current = 1; |
skip_current = 1; |
|
|
|
|
continue; |
|
| 1143 |
} |
} |
| 1144 |
} |
} |
| 1145 |
else |
else |
| 1146 |
{ |
{ |
| 1147 |
*p_buf_len = 0; |
*p_buf_offset = (int)(in_buf - p_buf); |
|
*p_buf_offset = 0; |
|
| 1148 |
*p_conv_len = (int)(conv_size - out_bytes); |
*p_conv_len = (int)(conv_size - out_bytes); |
|
|
|
|
break; |
|
| 1149 |
} |
} |
| 1150 |
} |
} |
| 1151 |
|
|