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

Fix Unicode character support #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AnErrupTion
Copy link

Hello! When updating my project to use the latest termbox2 code, I noticed printing characters such as U+250C (and other box drawing characters) stopped working, and instead it printed U+FFFD. This is due to recent changes that makes use of the iswprint(3) function to check if a Unicode character is printable or not.
However, by default, C uses the LC_CTYPE=C locale, which is ASCII-only, resulting in the aforementioned behavior. To fix this, I've added a line in tb_init() that sets LC_CTYPE to C.UTF-8, which is the same locale but compatible with UTF-8. This should work fine in most systems.

Signed-off-by: AnErrupTion <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant