take correct length of utf-8 strings

#length changed to #bytesize as the later returns the correct size of bytes for an utf-8 encoded string