add support for utf-8 in truncate helper