safely/robustly encode to 8bit string as utf8 from unicode