fix string encoding issues