fix output encoding (hopefully)