fixed utf-8 string length computation