GithubHelp home page GithubHelp logo

Comments (10)

nsf avatar nsf commented on May 19, 2024

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.

nuberudi avatar nuberudi commented on May 19, 2024

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.

gdamore avatar gdamore commented on May 19, 2024

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.

gdamore avatar gdamore commented on May 19, 2024

Actually, even more confusing are bidi languages... :-)

from termbox-go.

gdamore avatar gdamore commented on May 19, 2024

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.

thefallentree avatar thefallentree commented on May 19, 2024

Hi there,

In order to make things more clear, I can provide an example:

image

image

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.

gdamore avatar gdamore commented on May 19, 2024

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.

thefallentree avatar thefallentree commented on May 19, 2024

image

here are another demonstration.

from termbox-go.

thefallentree avatar thefallentree commented on May 19, 2024

@gdamore okay! we are giving it a shot! Thanks again for quick reply!

from termbox-go.

kybin avatar kybin commented on May 19, 2024

@thefallentree Termbox it self is not wrong. Error was in the example file. I just fixed it.

new_tbprint

from termbox-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.