non*_*ity 11 bash unicode ls tree ubuntu
Ubuntu 10.04ls
可以显示 unicode 字符,但tree
不能显示,即使使用tree --charset unicode
或utf8
。有没有办法解决。 echo
可以解释转义字符,除非cat list.txt | echo -e
不起作用(list.txt
来自 tree > list.txt
)
更新:tree -H www.somewhere.com
可以输出unicode(应该是UTF-8)但现在看来这是唯一的方法——作为一个网页。
$ 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
Run Code Online (Sandbox Code Playgroud)