fix utf-8 handling