Left is lf, and right is ranger.

@wheatdog From what I see in the screenshot, it seems to work for some characters but not for others. This is interesting. I suspect this issue is lf related though. It could be go related or maybe termbox related. Can you copy that filename here as a string so that I can do some testing?
This is strange. Does it work correctly in other cli utils? E.g. ls -l or sth.
The string is "第四章電路性能分析.ppt".
I am using st from suckless.org , and ls works.

Ok so I have tried the following:
package main
import "fmt"
func main() {
s := "第四章電路性能分析.ppt"
println(s)
fmt.Println(s)
for _, r := range s {
fmt.Printf("%c", r)
}
}
and it printed:
第四章電路性能分析.ppt
第四章電路性能分析.ppt
第四章電路性能分析.ppt
Then for termbox I tried:
package main
import (
"github.com/nsf/termbox-go"
)
func main() {
if err := termbox.Init(); err != nil {
panic(err)
}
defer termbox.Close()
s := "第四章電路性能分析.ppt"
termbox.Clear(termbox.ColorDefault, termbox.ColorDefault)
i := 0
for _, r := range s {
termbox.SetCell(i, 0, r, termbox.ColorDefault, termbox.ColorDefault)
i++
}
termbox.Flush()
termbox.PollEvent()
}
and it showed:
第章路能析ppt
So it looks like termbox related issue. I will take a further look at it later on.
@wheatdog Ok so it seems that there were two issues. First, the implementation was still using a quick and dirty logic using []byte which is now properly replaced with []rune. Second, we were not handling full width unicode CJK characters. This was more difficult and I had to add an extra dependency to the repo to make it work. Now the example you have provided seems to be working fine. More testing would be welcomed though as I still don't trust my understanding of unicodes.
Also note that, this fix is only for the filenames display yet. We still need to do the same for command prompt and configuration file.
It seems that unicode in the evaluator was already working. I have now fixed rune widths in the prompt as well. Closing this issue now.