text encode bug