fixed utf8 handling from stdout