Update I had deleted this nanswer because Brad's excellent answer and Valle Lukas's spot on comment seemed to render it moot. Then @p6steve confirmed both Brad's answer and Valle Lukas's solutions worked for them, so all the more reason to keep it deleted. But too late! A mistake in my nanswer had misled @p6steve who made a similar mistake in a follow up SO. Wea Culpa. To atone for my sins, I'm now permanently undeleting and leaving my shameful past for all to see.
This is a nanswer. I don't know Mac, but do love investigation, and what I've got to say won't fit in the comments.
Update The 'find .' in the following should be 'find', '.'. See run doc.
What do you get with this?:
say .out.lines given run 'find .', :out
If find . works, the problem is presumably tree.
If find . doesn't work, then try something really simple, that's built into MacOS, something that really should work. If it doesn't work, then the problem isn't tree but something more basic.
Malformed UTF-8 near bytes ef b9 5c
That means Raku was expecting UTF-8 but the input wasn't UTF-8.
Translating the message from computerese into English:
The supposedly English string "[Linux] xshell远程登陆CentOS时中文乱码解决_Cindy的博客 ..." is Malformed near 远程登.
In other words, the tree command is not generating UTF-8.
(Therefore using utf8-c8 will almost certainly be useless in the first instance. Its purpose is to cheat. It's for when text is either almost all UTF-8 except for a handful of rogue bytes, and you can't be bothered to sort out the input, or when you have absolutely no choice but to accept the input as it is and still want to muddle through. But in this case you surely ought either sort the problem out by getting to the bottom of things, or find some alternative to tree.)
Terminal encoding Unicode(UTF-8)
A google for "Terminal encoding Unicode(UTF-8)" yields just 7 matches. None appeared to be exact matches for "Terminal encoding Unicode(UTF-8)". All but one look to me like ... ef b9 5c looks to Rakudo. :)
If you copy/pasted that string, where did you copy it from?
If you yourself wrote that string, why were you so sure MacOS really was encoding tree's output as UTF-8 when run via the kernel (not a shell) that you wrote that it was?
run doesn't use a shell.
The current doc claims shell uses /bin/sh -c on MacOS.
What's the output of this?:
readlink -e $(which sh)
Is the output zsh?
If so sh -c should be using it.
If not, that may be the problem.
When one uses shell, one has to ensure the passed string is appropriately quoted and escaped. What do you get when you try these?:
say .out.lines given shell "'find .'", :out;
say .out.lines given shell "'tree --du'", :out;
What exactly is tree invoking? Is it a shell alias in zsh? If it's a binary, where did you install it from and how did you configure it, especially in terms of influencing zsh's handling of encodings?