stats/hdata: cope with Unicode when output is not a terminal