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

An interesting issue handling multi-bytes characters #98

Closed
greenlaw110 opened this issue Oct 3, 2019 · 3 comments
Closed

An interesting issue handling multi-bytes characters #98

greenlaw110 opened this issue Oct 3, 2019 · 3 comments

Comments

@greenlaw110
Copy link

Refer to actframework/actframework#1213

When use nc directly:
0

Using nc with rlwrap:
0

It looks to me that rlwrap isn't counting the column width correctly for muti-bytes chars

@greenlaw110 greenlaw110 changed the title An interesting issue handling multi-byte characters An interesting issue handling multi-bytes characters Oct 3, 2019
@greenlaw110
Copy link
Author

I have created a project to help reproduce this issue:

https://github.com/greenlaw110/rlwrap-issue

@hanslub42
Copy link
Owner

hanslub42 commented Nov 10, 2019

This has been high on my to-do list for some time, as it is a slightly embarrassing bug in 2019. rlwrap still uses good old strlen() to determine how wide a string will when displayed on your terminal, which yields an incorrect result when a multibyte character is displayed in one character cell in your locale.

My day job takes all my time at the moment, so this may take some time (this is a non-trivial project, simply replacing strlen() by some multi-byte aware version of it won't do the job)

@hanslub42
Copy link
Owner

This should be fixed by 46aadda

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

2 participants