Use \x22 instead of chr and encode