split utf8 streaming logic out of ansistream