Made UTF-8 handling more efficient