ta_mbtrunc(): Use mbtrunc() which is the proper method, instead of substr().
ta_mbpad(): Since ta_mbtrunc() might generate text with width of ($width-1) or less, depending on the width of the truncated wide character, we need to pad the truncated text to go to $width.