encodeToUTF8() improved