Problem: Message test only runs with one encoding. (Dominique Pelle)
Solution: Run the test with "utf-8" and "latin1". Fix underflow. (related
to #5410)
Problem: Not all arguments of trunc_string() are tested. Memory access
error when running the message tests.
Solution: Add another test case. (Yegappan Lakshmanan) Make it easy to run
unittests with valgrind. Fix the access error.