MIME4J-273 Update encodeB encoding bytes splitting point.

EncoderUtil.encodeIfNecessary(<unicode string>, EncoderUtil.Usage.TEXT_TOKEN, <number less than 10>) is broken in some cases, such as : https://issues.apache.org/jira/projects/MIME4J/issues/MIME4J-250?filter=allopenissues

The culprit is line
String part1 = text.substring(0, text.length() / 2);
Since the breaking point can be in between one unicode character. Once the string is breaking into two part, part1 will have a broken tail and part2 will have a broken head in this case.

Update test for failing testEncodeEncodedWordSplitForUnicode. Changed parameter is to force word split.
2 files changed