added utf8 encoding to stdout writes