Use localised utf8 functions here

and there's no need to work out the length over and over each step of
the text wrapping.