Truncate logs considering multi-byte strings

#11