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

Chinese, Japanese, emoji, full-width symbol characters miscounting #2

Open
rikkix opened this issue Jul 5, 2022 · 0 comments
Open

Comments

@rikkix
Copy link

rikkix commented Jul 5, 2022

image

image

image

image

image

So for Chinese, Japanese, emoji, full-width symbol characters, each of them takes up spaces twice than English letters.
However, with egg-mode-text 1.15.0 and the test code as below:

fn main() {
    println!("{}", egg_mode_text::character_count("hello", 23, 23));
    println!("{}", egg_mode_text::character_count("你好!", 23, 23));
    println!("{}", egg_mode_text::character_count("おはよう", 23, 23));
    println!("{}", egg_mode_text::character_count("🌞", 23, 23));
}

It prints out

5
3
4
1

, which should be 5, 6, 8, 2 instead.

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