str encode fix