Comments (6)
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.
from lf.
@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.
from lf.
@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?
from lf.
This is strange. Does it work correctly in other cli utils? E.g. ls -l
or sth.
from lf.
The string is "第四章電路性能分析.ppt".
I am using st
from suckless.org , and ls
works.
from lf.
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.
from lf.
Related Issues (20)
- sixel image preview not working with script but outputs multiple lines of characters when quitting lf HOT 2
- On Windows with pwsh, external trash command doesn't work with $Env:fx variable HOT 7
- on-redraw not being called on terminal resize HOT 3
- Bug: Tags broken on windows
- Problem with disown command HOT 7
- Feature Request: sepparate glob option for filter command HOT 1
- [BUG] When move failed with "permission denied" copy/cut buffer clearing. HOT 1
- setlocal depth/glob specification
- Dircount in previous pane not updated
- Bug: lf crashes when shell command is run in config file HOT 5
- Set shell interpreter seems not working for integrations HOT 4
- Video thumbnail previews with chafa HOT 5
- "set period 1" causes flickering in sixel image previews HOT 2
- Stopped working on Android HOT 2
- r33 changelog (preview) HOT 1
- r32 prints `^[[I` or `I` in libvte-based terminals HOT 5
- Setting a custom "root" directory HOT 1
- Alternate paste workflow (select then move/copy) doesnt work with multiple instances HOT 8
- Hidden file patterns for windows HOT 1
- Copy operations are (relatively) slow HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lf.