Ubuntu's ls can show unicode characters, but tree cannot, even with tree --charset unicode
Ubuntu 10.04's ls
can show unicode characters, but tree
cannot, even with tree --charset unicode
or utf8
. Is there a way to solve it. echo
could interpret the escape characters except cat list.txt | echo -e
won't work (list.txt
comes from tree > list.txt
)
Update: tree -H www.somewhere.com
can output unicode (should be in UTF-8) but right now it seems this is the only way -- as a webpage.
$ ls -R
.:
list2.txt list.txt 久未在遊行場合露面的前總統李登輝.txt 遊行
./遊行:
大家2.txt 大家.txt
$ tree --charset unicode
.
|-- list2.txt
|-- list.txt
|-- \344\271\205\346\234\252\345\234\250\351\201\212\350\241\214\345\240\264\345\220\210\351\234\262\351\235\242\347\232\204\345\211\215\347\270\275\347\265\261\346\235\216\347\231\273\350\274\235.txt
`-- \351\201\212\350\241\214
|-- \345\244\247\345\256\2662.txt
`-- \345\244\247\345\256\266.txt
1 directory, 5 files
$ tree --charset utf8
.
├── list2.txt
├── list.txt
├── \344\271\205\346\234\252\345\234\250\351\201\212\350\241\214\345\240\264\345\220\210\351\234\262\351\235\242\347\232\204\345\211\215\347\270\275\347\265\261\346\235\216\347\231\273\350\274\235.txt
└── \351\201\212\350\241\214
├── \345\244\247\345\256\2662.txt
└── \345\244\247\345\256\266.txt
1 directory, 5 files
Solution 1:
Try this:
tree -N