Fix string encoding problems