Improve handling of text output from build tools (avoid Unicode errors)