I’d say running your program from the console should work correctly because
Python can guess the console encoding of the terminal window (cp437 on US
Windows), but when run through a pipe Python uses the default of ascii. Try
changing your program to
enpreall Unipre output to an explicit encoding,
such as:
print (upper_line * len).enpre(‘cp437’)
Then when you read it from the pipe, you can either
depreback to Unipre
or print it directly to the terminal.



