encode segment labels as utf-8