encode string

encode string to utf-8 for json_econde.