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)
- lf image preview flickering HOT 5
- Duplicate icon
- Mouse buttons don't work
- Preview window colors HOT 14
- Yank path w/filename, filename, and file (As in Ranger) in Powershell HOT 6
- [QUESTION] Paste with overwrite for multiple files HOT 5
- Main Column Line Numbers Only HOT 8
- Outdated file information for recreated directories HOT 9
- directories have another font type HOT 2
- Feature request: highlighting of cursors when inactive HOT 3
- Feature request: add an lfrc switch to move duplicate copy suffixes at the beginning of filename. HOT 4
- `autoquit` should be enabled by default HOT 6
- how to use fribidi within lf.
- sixel preview writes out of bounds
- Broken characters of dir when I use `-print-last-dir` option / change drive option `/d` in `lfcd.cmd` HOT 3
- Issue with scrolling using alt key HOT 6
- Feature request: precalculate previews for files around the cursor HOT 3
- lf does not open terminal text editor when going right HOT 4
- Multishell/Crossplatform handling of `--` HOT 3
- how to use `lf -remote` in cmd? HOT 3
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.