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

Some wide characters are not correctly displayed #4

Open
qhwa opened this issue Apr 9, 2020 · 0 comments
Open

Some wide characters are not correctly displayed #4

qhwa opened this issue Apr 9, 2020 · 0 comments

Comments

@qhwa
Copy link

qhwa commented Apr 9, 2020

It seems that some of the Chinese characters are not displayed.

Let's take the hello world for example. Here's a script:
https://gist.github.com/qhwa/7ef65acb13ec656cc13d7418d066cfcc

when mix run it, the expected output will be:

Hello, World! 你好世界!

Whilst the current output is

Hello, World! 你世!

Looks like characters at even positions are missing.

Do you happen to have any idea how I can fix it?

FYI. I tried termbox the C program and confirms it works with Chinese characters.

UPDATE:
After some digging, I realize it is an issue with ratatouille on calculating positions. It is an issue about wide characters including CJK, full-width Unicode characters and some emojis. It can be fixed with a small patch calculating character width. On my local machine, I have got it working properly at least for some Chinese characters. I can make a pull request on it if it makes sense to you. :)

@qhwa qhwa changed the title Chinese characters are not correctly displayed Chinese texts are not correctly displayed Apr 9, 2020
@qhwa qhwa changed the title Chinese texts are not correctly displayed Some wide characters texts are not correctly displayed Apr 9, 2020
@qhwa qhwa changed the title Some wide characters texts are not correctly displayed Some wide characters are not correctly displayed Apr 9, 2020
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