fixed encoding of stdout for system commands