fix bug 1045303 - handle UTF-8 and control codes consistently

Ah sorry I should've mentioned something about that - I used different test data, so it looked more like what I see coming out of ```pyhs2```