Adding UTF-8 compatible version of the function ellipsize().