Encode strings to utf-8