6
▶ tree 下载 -L 1
344円270円213円350円275円275円
├── BT
├── ISO
├── Let\ s\ Play\ -\ Sniper\ Elite\ v2\ Nazi\ Zombie\ Army.flv
├── sniper\ elite\ v2\ 02.flv
└── 350円275円257円344円273円266円345円214円205円

those 7-bit ASCII output is non identifiable to human. Normally I use ascii2uni -a K to convert into UTF8. but in Fedora 25, the uni2ascii is not in repo. So any other way to make it output UTF8?

asked May 23, 2017 at 1:42

2 Answers 2

7

I found another answer on StackOverflow. Making changes to my locale settings didn't help at all, but using the -N option with tree did.

# tree -if ./my-path/
./my-path/Olaf\ Hund\ Vs\ Ursari\ De\ Clejani\ _\ Taraf\ De\ Hai210円douks\ _\ Koçani\ Orkestar\ -\ electric\ gypsyl.mp3
# tree -ifN ./my-path/
./my-path/Olaf Hund Vs Ursari De Clejani _ Taraf De Haïdouks _ Koçani Orkestar - electric gypsyl.mp3

Note that this also un-escapes spaces.

Jeff Schaller
68.8k35 gold badges122 silver badges263 bronze badges
answered Mar 5, 2020 at 19:01
3
  • It's 2 years post, fc31 is OK now. No need -N or any other command switch. Commented Mar 11, 2020 at 13:39
  • 1
    What is fc31? Another command line tool? Commented Mar 12, 2020 at 16:20
  • -N fix Chinese issue. Commented Aug 2, 2022 at 2:17
1

Set the encoding to UTF-8 (and choose an appropriate locale that has support for Unicode) e.g.:

LC_ALL=en_US.UTF-8 tree -L 1 下载

Presumably you are using a locale that can not interpret those characters (C maybe?).

Example:

% LC_ALL=C tree 下载 
344円270円213円350円275円275円
`-- foo
% LC_ALL=en_US.UTF-8 tree 下载 
下载
└── foo
answered May 23, 2017 at 3:05
1

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.