This is my code in Python:
[...]
proc = Popen(path, stdin=stdin, stdout=PIPE, stderr=PIPE)
result = [x for x in proc.stdout.readlines()]
result = ''.join(result);
Everything works fine, when it's ASCII. When I'm receiving UTF-8 text in stdout
the result is unpredictable. In most cases the output is damaged. What is wrong here?
Btw, maybe this code should be optimized somehow?