diff --git a/src/kits/textencoding/utf8_conversions.cpp b/src/kits/textencoding/utf8_conversions.cpp index 86ee58af73..fc221001ec 100644 --- a/src/kits/textencoding/utf8_conversions.cpp +++ b/src/kits/textencoding/utf8_conversions.cpp @@ -39,6 +39,11 @@ convert_encoding(const char * from, const char * to, do { size_t nonReversibleConversions = iconv(conversion,inputBuffer,&inputLeft,&dst,&outputLeft); if (nonReversibleConversions == (size_t)-1) { + if (errno == E2BIG) { + // Not enough room in the output buffer for the next converted character + // This is not a "real" error, we just quit out. + break; + } switch (errno) { case EILSEQ: // unable to generate a corresponding character { @@ -71,9 +76,6 @@ convert_encoding(const char * from, const char * to, inputBuffer++; inputLeft--; break; - case E2BIG: - // not enough room in the output buffer for the next converted character - break; default: // unknown error, completely bail status = errno;