truncate utf-8 string at the correct offset, instead of one char too long
Signed-off-by: Mike Day <ncmike@ncultra.org>