I have a program that generates the following output:
┌───────────────────────┐
│10 day weather forecast│
└───────────
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 encode all Unicode output to an explicit encoding, such as:
print (upper_line * len).encode('cp437')
Then when you read it from the pipe, you can either decode back to Unicode or print it directly to the terminal.