fixed the bug about E2BIG
@@ -305,7 +305,10 @@ | ||
305 | 305 | |
306 | 306 | std::size_t res = cv.convert(src, src_size, dst, dst_size); |
307 | 307 | if (res == detail::iconv_wrapper::error) |
308 | - throw std::runtime_error("failed iconv()"); | |
308 | + { | |
309 | + if (errno != E2BIG) | |
310 | + throw std::runtime_error("failed iconv()"); | |
311 | + } | |
309 | 312 | |
310 | 313 | std::size_t len = dst-dst_buf; |
311 | 314 | std::memcpy(tmp, dst_buf, len); |