Encode unicode values before saving them to cache