Wrong line-drawing characters when write "tree" command output to file Under macOS Catalina 10.15.1, Using the standard "tree" command (as supplied by MacPorts), if at the Terminal prompt I cd to a folder and then execute tree there,  I get output like this:

.
├── Activity\ Monitor.app
├── ApplicationsFolderIcon.icns
├── BBEdit.app
├── Backup
│   ├── Backup\ and\ Sync\ from\ Google.app
│   ├── Carbon\ Copy\ Cloner.app
│   ├── Dropbox.app\ 
│   ├── ForeverSave\ 2.app
│   ├── Get\ Backup\ Pro\ 3.app


However, if I redirect the output to a text file, as in

tree &gt; myapps.txt


then I get wrong characters when I view the file in TextEdit:

.
‚îú‚îÄ‚îÄ Activity\ Monitor.app
‚îú‚îÄ‚îÄ ApplicationsFolderIcon.icns
‚îú‚îÄ‚îÄ BBEdit.app
‚îú‚îÄ‚îÄ Backup
‚îÇ¬†¬† ‚îú‚îÄ‚îÄ Backup\ and\ Sync\ from\ Google.app
‚îÇ¬†¬† ‚îú‚îÄ‚îÄ Carbon\ Copy\ Cloner.app
‚îÇ¬†¬† ‚îú‚îÄ‚îÄ Dropbox.app\ 
‚îÇ¬†¬† ‚îú‚îÄ‚îÄ ForeverSave\ 2.app
‚îÇ¬†¬† ‚îú‚îÄ‚îÄ Get\ Backup\ Pro\ 3.app


What's wrong?
Use either of these to get compatible characters. 

tree --charset=ascii &gt; a.txt
tree --charset unicode &gt; a.txt


https://unix.stackexchange.com/questions/127063/tree-command-output-with-pure-7-bit-ascii-output