Error tolerant output decoding

Avoid throwing an exception if the program output is not valid unicode. Replace invalid bytes by the unicode replacement character.