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

Full-width Unicode is not supported #2

Open
sebseager opened this issue Sep 1, 2022 · 0 comments
Open

Full-width Unicode is not supported #2

sebseager opened this issue Sep 1, 2022 · 0 comments

Comments

@sebseager
Copy link
Owner

Double-width UTF-encoded symbols (e.g., emojis, full-width East Asian chars, etc.) don't render properly, as all characters are expected to have a width of 1. To see this, change rx += 1 to rx += 2 in cx_to_rx, and cur_rx += 1 to cur_rx += 2 in rx_to_cx. The cursor will position correctly when adding an emoji, for instance, but will break for single-width Unicode chars.

Sounds like we need to use wcwidth and wcswidth to get the actual width of these when rendering.

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

No branches or pull requests

1 participant