Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there utf8 support? #12

Open
mendisobal opened this issue Jun 21, 2020 · 5 comments
Open

is there utf8 support? #12

mendisobal opened this issue Jun 21, 2020 · 5 comments

Comments

@mendisobal
Copy link

Do you plan utf8 support?

@waruqi
Copy link
Member

waruqi commented Jun 21, 2020

I don't have time to support it now.

@laelnasan
Copy link
Contributor

laelnasan commented Dec 4, 2020

In linux I managed to have utf8 running by simply linking to ncursesw. There are some issues with drawing on short views, but it may be simple to solve it with Lua 5.4 or with a library such as https://github.com/starwing/luautf8

image

I will investigate it further when I have the time

@waruqi
Copy link
Member

waruqi commented Dec 4, 2020

In linux I managed to have utf8 running by simply linking to ncursesw.

We also need to consider pdcurse with wchar.

There are some issues with drawing on short views, but it may be simple to solve it with Lua 5.4 or with a library such as https://github.com/starwing/luautf8

I also need to consider the compatibility with xmake, because xmake also uses ltui, https://github.com/xmake-io/xmake/tree/master/xmake/core/ui

But xmake's ltui does not need luautf8, because its runtime rewrites built-in lua modules such as io/string, and has added support for utf8.

I will investigate it further when I have the time

Thanks

@laelnasan
Copy link
Contributor

laelnasan commented Dec 5, 2020

I also need to consider the compatibility with xmake, because xmake also uses ltui, https://github.com/xmake-io/xmake/tree/master/xmake/core/ui

But xmake's ltui does not need luautf8, because its runtime rewrites built-in lua modules such as io/string, and has added support for utf8.

this pr #27 solves the splitting of utf8 strings and also permits utf8 input in textedit views.
Both ncurses and pdcurses use codes greater then 0xFF for special key codes, hence the limitation for codes < 0x7f is not strictly needed AFAIK

We also need to consider pdcurse with wchar.

I've submitted a pr #28 with the required flag for pdcurses, but I didn't test it, I got access to a windows machine but didn't set up the environment yet. I tried to use ltui over ssh (putty), though. If the utf8 support comes to be, it would be nice to permit the user to choose utf8 glyphs instead of ACS characters:

image

the utf8 characters and mouse events work fine over ssh. Great for embedded applications!

@waruqi
Copy link
Member

waruqi commented Dec 6, 2020

Thank you very much, as long as you can ensure compatibility with xmake's ui module, only modify curses/pdcurses, or replace some native io interfaces, I welcome pr.

But I don't want to add new c modules and interface calls to ltui. Because when these patches are merged into xmake, these c libraries will also be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants