encode properties and events in utf-8