fix a bug of toMimeEncoded() and update a test case.
fix compile error of a test case.