encode transformes a string from unicode to str