Remove uses of chr and encode