Encode values as utf-8 before encrypting

Ensure strings are correctly encoded before encrypting

This is necessary because some encryption libraries don't handle
the unicode conversion appropriately.

Change-Id: Iebbf32e57ba21d955c1984ee32360379579366c8
Closes-Bug: #1207707
Merge "Encode values as utf-8 before encrypting"