Commit Graph

1 Commits

Author SHA1 Message Date
MoZhonghua
331deca0a8 Fix #17: NewReader can't process data bigger than 8K
This shoud also fix issue #25: When the amount of data will be truncated

iconv() will return EINVAL when An incomplete multibyte sequence is
encountered in the input, and the input byte sequence terminates after
it. So if the input is larger than the internal buffer of Reader and
the end of the buffer conatins partial multi-byte chars, then Reader
will failed with EINVAL.

So when iconv() return EINVAL, we checks whether there are more data to
process, if so, we continue without report an error to user.
2016-06-18 17:02:05 +08:00