Encode HTML special characters before saving to database