python subprocess.call not showing certain characters

I’m trying to call tree in python with subprocess.call but instead of returning “│” it only returns “�”, this also happens with os.system.
using python 3
windows 10

Answer

This is the horror of working with character sets in Windows. The application is printing out one of the line-drawing characters. In the MS-DOS code page, that’s probably 0x10. Depending on how your terminal is set up, that might print as a vertical line, or it might print as something else. If the app has the option to print out ASCII art ( + – | ), that will be more universal.