encode as utf-8 when converting to string