Comments (10)
Honestly, I have no idea how chinese input works. Termbox doesn't have "official" support for wide characters, unless someone implements it properly. It's a tricky question because it also needs to work on windows.
from termbox-go.
Wow, that was fast, thank you man!
The good thing is that if you write characters one by one and then hit space, it works. Of course it's a very slow input method.
Well, I think I'll have to continue using the normal console for the input but maybe I still can use termbox to review the data later.
Thanks again!
from termbox-go.
The problem is that the character you are pasting wide, so editbox is probably not quite right here. That's just a demo program, so I wouldn't worry about it very much.
If you know you're going to be working with wide characters, you need to be careful in rendering them, understanding that each character may consist of multiple bytes, and may occupy either 1, 2, or even 0 cells. Its hard to get this right without some care, and the Asian locales are the most confusing to deal with.
from termbox-go.
Actually, even more confusing are bidi languages... :-)
from termbox-go.
So it turns out not to have been as difficult as I feared -- provided we elide combining characters. Double wide characters are fairly straight forward -- as seen above. Please give it a try.
from termbox-go.
Hi there,
In order to make things more clear, I can provide an example:
You can see there seems to be some width calculation error , the characters are not being fully displayed .
We are testing your fix right now, will let you know.
from termbox-go.
Feel free also to give github.com/gdamore/tcell/termbox a shot. I think it has a good chance of Just Working for you. And it supports wide characters properly I think. (And if you use the parent package instead, tcell, you get nice support for even combining characters.)
from termbox-go.
here are another demonstration.
from termbox-go.
@gdamore okay! we are giving it a shot! Thanks again for quick reply!
from termbox-go.
@thefallentree Termbox it self is not wrong. Error was in the example file. I just fixed it.
from termbox-go.
Related Issues (20)
- device not configured HOT 5
- tmux-256color $TERM unsupported
- panic: The handle is invalid. HOT 1
- Keybindings not working on FreeBSD HOT 2
- Wine panics ("Invalid handle")
- build failure on gnu/hurd HOT 3
- Understanding character codes / sequences HOT 3
- Copy-pastable line wrap HOT 2
- Version tagging HOT 1
- Panic on FreeBSD host HOT 5
- ShowCursor Function
- Save current history/screen in plain text HOT 4
- Why output is ahead of my command rather than after?
- can it support emoji HOT 1
- Chinese characters support issue HOT 1
- KeyEnter and KeyCtrlM map to the same Hex value HOT 1
- Chinese character width occupation problem HOT 3
- how to use with custom pty example ssh
- How do I detect a double-click mouse event?
- Add support for SetOutputMode other than OutputNormal for Windows Terminal
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 termbox-go.