improved utf8 array conversion