glibc iconv has a known bug where it doesn't handle the magic
IGNORE stanza correctly. In particular, rather than ignore
characters, it will return an EILSEQ after consuming some number
of characters, and expect you to restart iconv as if it were
an E2BIG. Old versions of PHP did not respect the errno, and
returned the fragment, so as a result you would see iconv
mysteriously truncating output. We can work around this by
manually chopping our input into segments of about 8000
characters, as long as PHP ignores the error code. If PHP starts
paying attention to the error code, iconv becomes unusable.
public static testIconvTruncateBug ( ) : integer | ||
return | integer | Error code indicating severity of bug. |