Encode data for copying to clipboard.