utf8 encoding length fix